1、環境介紹
涉及到軟件下載地址:https://pan.baidu.com/s/1hpcXUSJe85EsU9ara48MsQ
服務器:CentOS 6.8
JDK:jdk-8u191-linux-x64.tar.gz
hadoop:hadoop-3.1.1
hadoop3.1.1 HA高可用分布式集群安裝部署:https://www.cnblogs.com/lufan2008/p/10312085.html
hbase:hbase-2.0.4-bin.tar.gz
2、安裝 hbase
tar -zxvf /usr/local/soft/hbase-2.0.4-bin.tar.gz -C /usr/local/
vim /etc/profile #增加HBASE環境變量內容 export HBASE_HOME=/usr/local/hbase-2.0.4 export PATH=$HBASE_HOME/bin:$PATH
使環境變量生效:source /etc/profile
vim /usr/local/hbase-2.0.4/conf/hbase-env.sh #增加內容 #HBASE_CLASSPATH值一定要改成 hadoop 的目錄,不然不認識集群名稱 export HBASE_CLASSPATH=/usr/local/hadoop-3.1.1/etc/hadoop export JAVA_HOME=/usr/local/jdk1.8.0_191 export HBASE_MANAGES_ZK=false
vim /usr/local/hbase-2.0.4/conf/regionservers hadoop4 hadoop5
vim /usr/local/hbase-2.0.4/conf/hbase-site.xml <configuration> <property> <name>hbase.unsafe.stream.capability.enforce</name> <value>false</value> </property> <property> <name>hbase.rootdir</name> <value>hdfs://mycluster/hbase</value> </property> <!--啟用分布式集群--> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> <!--默認HMaster HTTP訪問端口--> <property> <name>hbase.master.info.port</name> <value>16010</value> </property> <!--默認HRegionServer HTTP訪問端口--> <property> <name>hbase.regionserver.info.port</name> <value>16030</value> </property> <property> <name>zookeeper.znode.parent</name> <value>/hbase</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>192.168.67.1</value> </property> <property> <name>hbase.zookeeper.property.clientPort</name> <value>2181</value> </property> <property> <name>hbase.coprocessor.abortonerror</name> <value>false</value> </property> </configuration>
#設置除了本機以外的所有master服務器的名稱,每台master服務器上內容不一樣,用於故障轉移 #在 hadoop3 的上設置
vim /usr/local/hbase-2.0.4/conf/backup-masters hadoop2
#設置除了本機以外的所有master服務器的名稱,每台master服務器上內容不一樣,用於故障轉移 #在 hadoop2 的上設置 vim /usr/local/hbase-2.0.4/conf/backup-masters hadoop3
3、啟動和停止
#啟動,在任意一台master上執行 start-hbase.sh #停止 stop-hbase.sh
4、驗證
4.1 訪問地址:
http://192.168.67.103:16010/master-status
http://192.168.67.102:16010/master-status
http://192.168.67.104:16030/rs-status
http://192.168.67.105:16030/rs-status