集群结构如下
NodeName | Master | RegionServer | Zookeeper |
---|---|---|---|
namenode | yes | no | yes |
datanode2 | backup | yes | yes |
datanode3 | no | yes | yes |
在namenode上执行如下脚本:
cd /data/apache
wget http://mirror.bit.edu.cn/apache/hbase/1.3.1/hbase-1.3.1-bin.tar.gz
tar xfvz hbase-1.3.1-bin.tar.gz
cd hbase-1.3.1/conf
vim regionservers (删除localhost,添加其他的节点)
echo "datanode2" >> backup-masters (以datanode2作为secondary Master)
vim hbase-env.sh
export JAVA_HOME=/data/java/jdk1.8.0_131
export HBASE_MANAGES_ZK=false
vim hbase-site.xml
scp -r /data/apache/hbase-1.3.1 datanode2:/data/apache
scp -r /data/apache/hbase-1.3.1 datanode3:/data/apache
cd ../bin
./start-hbase.sh
jps (查看是否启动了相应的HMaster,HRegionServer进程)
hbase-site.xml
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://namenode:8020/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>namenode,datanode2,datanode3</value>
</property>
</configuration>
Web UI
Master:http://namenode:16010
secondary master:http://datanode2:16010
RegionServer:http://datanode:16030
网友评论