1, download HBase 2.2.2 Download
2, upload it to / usr / local directory
3, extract, rename
tar -zxf hbase-2.2.2-bin.tar.gz
mv hbase-2.2.2 hbase
4, configure the environment variables
Add the bin directory under hbase to the path, so, there is no need to start hbase under / usr / local / hbase directory, which greatly facilitates the use of hbase. The following portion of the tutorial or switching to the / usr / local / hbase directory operations help beginners appreciated that during operation, then switching may not necessarily skilled.
Edit / etc / profile file
vi / etc / profile # Edit File
Export the PATH = $ the PATH: / usr / local / HBase / bin # file to the end of the paragraph
Source / etc / Profile # validate the configuration
5, the pseudo-distributed configuration
Configuration /usr/local/hbase/conf/hbase-env.sh. Command is as follows:
we /usr/local/hbase/conf/hbase-env.sh
Configuring the JAVA_HOME, HBASE_CLASSPATH, HBASE_MANAGES_ZK.
HBASE_CLASSPATH conf directory is provided under native Hadoop installation directory (i.e., / usr / local / hadoop / conf )
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 export HBASE_CLASSPATH=/usr/local/hadoop/conf export HBASE_MANAGES_ZK=true
/Usr/local/hbase/conf/hbase-site.xml configuration
command to open and edit vi hbase-site.xml, the following command:
we /usr/local/hbase/conf/hbase-site.xml
Modify hbase.rootdir, HBase data storage path specified in the HDFS; hbase.cluter.distributed attribute set to true. Hadoop cluster assumed that the current running in the machine running in the pseudo-distributed mode, and run at 9000 NameNode port.
<configuration> <property> <name>hbase.rootdir</name> <value>hdfs://localhost:9000/hbase</value> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> </configuration>
6, the next test run HBase.
The first step: the first landing ssh, no password set before, so no password is required here; then switch to the directory / usr / local / hadoop; restart hadoop, if already started hadoop skip this step. Command is as follows:
ssh localhost cd /usr/local/hadoop ./sbin/start-dfs.sh
Enter the command jps, to see NameNode, DataNode and SecondaryNameNode have been successfully started, represents a successful start hadoop, shots are as follows:
Step Two: switching to the directory / usr / local / hbase; HBase restart command is as follows:
cd /usr/local/hbase
bin/start-hbase.sh
Starts successfully, enter the command jps, see the following interface description hbase successful start
into the shell interface:
bin/hbase shell
Screenshot below:
7, stop running HBase, orders are as follows:
bin/stop-hbase.sh
Note: If an error occurs during the operation of the HBase may be a subfolder of logs in a log file view the error cause by {HBASE_HOME} directory (/ usr / local / hbase) .
Here off Hadoop and HBase startup sequence must be:
Start Hadoop-> start HBase-> Close HBase-> Close Hadoop