JAVA_HOME
to the root of your Java installation when configuring Hadoop.
Start by defining the following directory variables for your convenience:
${HADOOP_HOME}
: The root directory of your Hadoop installation.${HBASE_HOME}
: The HBase root, located at
${HADOOP_HOME}/src/contrib/hbase
.If you are running a standalone operation, proceed to Running and Confirming Your Installation. If you are running a distributed operation, continue below.
Make sure you have followed
Hadoop's instructions for running a distributed operation.
Configuring HBase for a distributed operation requires modification of the following two
files: ${HBASE_HOME}/conf/hbase-site.xml
and
${HBASE_HOME}/conf/regionservers
.
hbase-site.xml
allows the user to override the properties defined in
${HBASE_HOME}/conf/hbase-default.xml
. hbase-default.xml
itself
should never be modified. At a minimum the hbase.master
property should be redefined
in hbase-site.xml
to define the host:port
pair on which to run the
HMaster (read about the
HBase master, regionservers, etc):
<configuration> <property> <name>hbase.master</name> <value>[YOUR_HOST]:[PORT]</value> <description>The host and port that the HBase master runs at. </description> </property> </configuration>
The regionserver
file lists all the hosts running HRegionServers, one
host per line (This file is synonymous to the slaves file at
${HADOOP_HOME}/conf/slaves
).
${HBASE_HOME}/conf/hbase-env.sh
.If you are running a distributed operation you will need to start the Hadoop daemons before starting HBase and stop the daemons after HBase has shut down. Start and stop the Hadoop daemons as per the Hadoop instructions. Afterwards, or if running a standalone operation, start HBase with the following command:
${HBASE_HOME}/bin/start-hbase.sh
Once HBase has started, enter ${HBASE_HOME}/bin/hbase shell
to obtain a
shell against HBase from which you can execute HBase commands. In the HBase shell, type
help;
to see a list of supported commands. Note that all commands in the HBase
shell must end with ;
. Test your installation by creating, viewing, and dropping
a table, as per the help instructions. Be patient with the create
and
drop
operations as they may each take 10 seconds or more. To stop hbase, exit the
HBase shell and enter:
${HBASE_HOME}/bin/stop-hbase.sh
If you are running a distributed operation, be sure to wait until HBase has shut down completely before stopping the Hadoop daemons.
The default location for logs is ${HADOOP_HOME}/logs
.
HBase also puts up a UI listing vital attributes. By default its deployed on the master host at port 60010.