1.配置
在CentOS7Three上配置,注意:一定要安装bin包,不能安装src包
/usr/local/hbase/hbase-2.0.5/conf
编辑hbase-env.sh,替换成如下配置
export JAVA_HOME=/usr/lib/jvm/java-1.8.-openjdk
export HBASE_MANAGES_ZK=false #用外部zk
编辑hbase-site.xml,增加配置
<property>
<name>hbase.rootdir</name>
<value>hdfs://ns1/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>CentOS7Five:,CentOS7Six:,CentOS7Seven:</value>
</property>
编辑regionservers
CentOS7Five
CentOS7Six
CentOS7Seven
复制Hadoop的core-site.xml和hdfs-site.xml到hbase的conf下,为了hbase能识别nameservice
cp /usr/local/hadoop-2.6./hadoop-2.6./etc/hadoop/{core-site.xml,hdfs-site.xml} /usr/local/hbase/hbase-2.0./conf/
复制到其他机器
scp -r /usr/local/hbase/ CentOS7Four:/usr/local/
scp -r /usr/local/hbase/ CentOS7Five:/usr/local/
scp -r /usr/local/hbase/ CentOS7Six:/usr/local/
scp -r /usr/local/hbase/ CentOS7Seven:/usr/local/
新建backup-masters
填入CentOS7Four,作为备用HMaster
2.启动
在CentOS7Three上启动hbase
sh /usr/local/hbase/hbase-2.0./bin/start-hbase.sh
浏览器输入http://centos7three:16010/master-status
进入hbase的shell
sh /usr/local/hbase/hbase-2.0./bin/hbase shell