一、节点规划
hadoop1、hadoop2 | HMaster |
hadoop3、hadoop4、hadoop5 | HRegionServer |
二、配置环境变量
export HBASE_HOME=/usr/local/hbase export PATH=:$HBASE_HOME/bin:$PATH
三、解压hbase
四、修改配置参数
1.hbase-env.sh
[root@hadoop1 ~]# cat /usr/local/hbase/conf/hbase-env.sh | grep -v [#] | grep -v '^$' export JAVA_HOME=/usr/local/jdk export HBASE_CLASSPATH=/usr/local/hbase/conf export HADOOP_HOME=/usr/local/hadoop export HBASE_OPTS="-XX:+UseConcMarkSweepGC" export HBASE_MANAGES_ZK=false
2.hbase-site.xml
<configuration> <property> <name>hbase.rootdir</name> <value>hdfs://master:/hbase</value> </property> <property> <name>hbase.master</name> <value>60000</value> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> <property> <name>hbase.zookeeper.property.dataDir</name> <value>/usr/local/zookeeper</value> </property> <property> <name>hbase.tmp.dir</name> <value>/usr/local/hbase/tmp</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>hadoop3,hadoop4,hadoop5</value> </property> <property> <name>hbase.zookeeper.property.clientPort</name> <value>2181</value> </property> </configuration>
3.regionservers
[root@hadoop1 ~]# cat /usr/local/hbase/conf/regionservers hadoop3 hadoop4 hadoop5
五、拷贝到其他节点
scp -r /usr/local/hbase root@hadoop2:/usr/local/
六、启动hbase(需要先启动hdfs)
start-hbase.sh
[root@hadoop1 ~]# jps 3040 DFSZKFailoverController 4281 HMaster 5034 Jps 2303 NameNode
在hadoop2上启动HMaster实现HA
[root@hadoop2 ~]# hbase-daemon.sh start master starting master, logging to /usr/local/hbase/logs/hbase-root-master-hadoop2.out [root@hadoop2 ~]# jps 2450 NameNode 2714 DFSZKFailoverController 3085 HMaster 3150 Jps
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/192876.html