一、节点规划
hadoop1、hadoop2 | HMaster |
hadoop3、hadoop4、hadoop5 | HRegionServer |
二、配置环境变量
export HBASE_HOME=/usr/local/hbase export PATH=:$HBASE_HOME/bin:$PATH
三、解压hbase
四、修改配置参数
1.hbase-env.sh
[[email protected] ~]# 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
[[email protected] ~]# cat /usr/local/hbase/conf/regionservers hadoop3 hadoop4 hadoop5
五、拷贝到其他节点
scp -r /usr/local/hbase [email protected]:/usr/local/
六、启动hbase(需要先启动hdfs)
start-hbase.sh
[[email protected] ~]# jps 3040 DFSZKFailoverController 4281 HMaster 5034 Jps 2303 NameNode
在hadoop2上启动HMaster实现HA
[[email protected] ~]# hbase-daemon.sh start master starting master, logging to /usr/local/hbase/logs/hbase-root-master-hadoop2.out [[email protected] ~]# jps 2450 NameNode 2714 DFSZKFailoverController 3085 HMaster 3150 Jps
时间: 2024-10-09 07:01:04