1、下載hbase的安裝文件
本次安裝下載的是hbase-0.94.17-security.tar.gz,解壓縮,然後進入解壓後的目錄
$ tar -zxvfhbase-0.94.17-security.tar.gz
$ cdhbase-0.94.17-security
2、編輯配置文件
1) 編輯conf/hbase-site.xml
<configuration>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.rootdir</name>
<value>hdfs://localhost:9000/hbase</value>
<description>The directory shared byRegionServers.
</description>
</property>
<property>
<name>dfs.replication</name>
<value>true</value>
<description>The replication countfor HLog HFile storage. Should not be greater than HDFS datanode count.
</description>
</property>
</configuration>
首先設置hbase.cluster.distributed=true,即使用分佈式集羣模式;然後設置默認hbase.rootdir指向hdfs://localhost:9000/hbase。
2) 編輯hbase-env.sh裏的配置內容
# The javaimplementation to use.
exportJAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
# ExtraJava CLASSPATH elements.Optional.
exportHBASE_CLASSPATH=/home/ubuntu/hbase-0.94.17-security/conf
# TellHBase whether it should manage it's own instance of Zookeeper or not.
exportHBASE_MANAGES_ZK=true
將JAVA_HOME設置爲java的安裝路徑,設置HBASE_CLASSPATH路徑,並將HBASE_MANAGES_ZK設置爲true,即使用默認的Zookeeper.
3) 寫環境變量
爲了便於操作,將hbase中.sh所在的$HBASE_HOME/bin路徑寫進/etc/profile中,並source/etc/profile
3、啓動hbase
$ start-hbase.sh$ jps 查看當前啓動的進程
4、進入shell模式
5、測試實例:創建一個表
6、 web頁面查看安裝結果