HBASE-HA搭建
Zookeeper集群的正常部署,并启动[三个节点]
zkServer.sh start
Hadoop集群的正常部署并启动[三个节点]
start-dfs.sh
start-yarn.sh
HBASE高可用搭建
hbase-env.sh
export JAVA_HOME=/opt/app/jdk1.8.0_321
# 不使用自带的zookeeper
export HBASE_MANAGES_ZK=false
hbase-site.xml
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://HadoopCluster/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<!-- 0.98后的新变动,之前版本没有.port,默认端口为60000 -->
<property>
<name>hbase.master.port</name>
<value>16000</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>node1:2181,node2:2181,node3:2181</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/opt/app/zookeeper-3.4.6/zkData/</value>
</property>
</configuration>
regionservers
node1
node2
node3
hbase需要依赖的jar包
- 查询包命令
find /home/admin/modules/hadoop-2.7.2/ -name hadoop-annotations*
# 依赖的包汇总如下:[选择合适的版本]
hadoop-annotations-2.7.2.jar
hadoop-auth-2.7.2.jar
hadoop-client-2.7.2.jar
hadoop-common-2.7.2.jar
hadoop-hdfs-2.7.2.jar
hadoop-mapreduce-client-app-2.7.2.jar
hadoop-mapreduce-client-common-2.7.2.jar
hadoop-mapreduce-client-core-2.7.2.jar
hadoop-mapreduce-client-hs-2.7.2.jar
hadoop-mapreduce-client-hs-plugins-2.7.2.jar
hadoop-mapreduce-client-jobclient-2.7.2.jar
hadoop-mapreduce-client-jobclient-2.7.2-tests.jar
hadoop-mapreduce-client-shuffle-2.7.2.jar
hadoop-yarn-api-2.7.2.jar
hadoop-yarn-applications-distributedshell-2.7.2.jar
hadoop-yarn-applications-unmanaged-am-launcher-2.7.2.jar
hadoop-yarn-client-2.7.2.jar
hadoop-yarn-common-2.7.2.jar
hadoop-yarn-server-applicationhistoryservice-2.7.2.jar
hadoop-yarn-server-common-2.7.2.jar
hadoop-yarn-server-nodemanager-2.7.2.jar
hadoop-yarn-server-resourcemanager-2.7.2.jar
hadoop-yarn-server-tests-2.7.2.jar
hadoop-yarn-server-web-proxy-2.7.2.jar
zookeeper-3.4.6.jar
rm -rf /opt/app/hbase-1.6.0/lib/hadoop-*
rm -rf /opt/app/hbase-1.6.0/lib/zookeeper-3.4.6.jar
[root@node1 common]# pwd
/opt/app/hadoop-2.8.5/share/hadoop/common
[root@node1 common]# cp hadoop-common-2.8.5.jar /opt/app/hbase-1.6.0/lib/
[root@node1 hdfs]# pwd
/opt/app/hadoop-2.8.5/share/hadoop/hdfs
[root@node1 hdfs]# cp hadoop-hdfs-2.8.5.jar /opt/app/hbase-1.6.0/lib/
[root@node1 mapreduce]# pwd
/opt/app/hadoop-2.8.5/share/hadoop/mapreduce
[root@node1 mapreduce]# cp hadoop-mapreduce-client-* /opt/app/hbase-1.6.0/lib/
[root@node1 yarn]# pwd
/opt/app/hadoop-2.8.5/share/hadoop/yarn
[root@node1 yarn]#
cp
hadoop-yarn-api-2.8.5.jar
hadoop-yarn-applications-distributedshell-2.8.5.jar
hadoop-yarn-applications-unmanaged-am-launcher-2.8.5.jar
hadoop-yarn-client-2.8.5.jar
hadoop-yarn-common-2.8.5.jar
hadoop-yarn-server-applicationhistoryservice-2.8.5.jar
hadoop-yarn-server-common-2.8.5.jar
hadoop-yarn-server-nodemanager-2.8.5.jar
hadoop-yarn-server-resourcemanager-2.8.5.jar
hadoop-yarn-server-tests-2.8.5.jar
hadoop-yarn-server-web-proxy-2.8.5.jar /opt/app/hbase-1.6.0/lib/
[root@node1 lib]# cp /opt/app/hadoop-2.8.5/share/hadoop/mapreduce/lib/hadoop-annotations-2.8.5.jar /opt/app/hbase-1.6.0/lib/
[root@node1 lib]# cp /opt/app/hadoop-2.8.5/share/hadoop/common/lib/hadoop-auth-2.8.5.jar /opt/app/hbase-1.6.0/lib/
hadoop-client-2.8.5.jar没找到,手动导入的
[root@node1 zookeeper-3.4.6]# pwd
/opt/app/zookeeper-3.4.6
[root@node1 zookeeper-3.4.6]# cp zookeeper-3.4.6.jar /opt/app/hbase-1.6.0/lib/
HBase软连接Hadoop配置
ln -s /opt/app/hadoop-2.8.5/etc/hadoop/core-site.xml /opt/app/hbase-1.6.0/conf/core-site.xml
ln -s /opt/app/hadoop-2.8.5/etc/hadoop/hdfs-site.xml /opt/app/hbase-1.6.0/conf/hdfs-site.xml
HBase服务启动/关闭
方式一:
# 启动
[node1]# hbase-daemon.sh start master
[node1]# hbase-daemon.sh start regionserver
[node2]# hbase-daemon.sh start regionserver
[node3]# hbase-daemon.sh start regionserver
# 关闭
[node1]# hbase-daemon.sh stop master
[node1]# hbase-daemon.sh stop regionserver
[node2]# hbase-daemon.sh stop regionserver
[node3]# hbase-daemon.sh stop regionserver
方式二:三台都会启动
[node1]# start-hbase.sh
[node1]# stop-hbase.sh
访问HBase页面
http://192.168.200.111:16010/
本文来自博客园,作者:jsqup,转载请注明原文链接:https://www.cnblogs.com/jsqup/p/16672009.html