1、部署Hadoop
https://www.jianshu.com/p/2d8518b19ee5
2、部署Zookeeper
https://www.jianshu.com/p/e04167aef33a
3、HBase解压到指定目录
[victor@node1 software]$ tar -xzvf hbase-1.2.5-bin.tar.gz -C /opt/module/
4、HBase的配置文件
hbase-env.sh
export JAVA_HOME=/opt/module/jdk1.8.0_144
export HBASE_MANAGES_ZK=false
export HBASE_CLASSPATH=/opt/module/hbase/conf
export HBASE_LOG_DIR=/opt/module/hbase/logs
尖叫提示:如果使用的是JDK8及以上版本,则应在hbase-evn.sh中移除“HBASE_MASTER_OPTS”
和“HBASE_REGIONSERVER_OPTS”配置。
hbase-site.xml
hbase.rootdir
hdfs://node1:9000/hbase
hbase.cluster.distributed
true
hbase.master.port
16000
hbase.zookeeper.quorum
node1:2181,node2:2181,node3:2181
hbase.zookeeper.property.dataDir
/opt/module/zookeeper-3.4.10/zkdata
尖叫提示:hbase-site.xml的默认配置文件地址
hbase-1.2.5\hbase-common\src\main\resources\hbase-default.xml
regionservers
node1
node2
node3
5、HBase需要依赖的Jar包
由于HBase需要依赖Hadoop,所以替换HBase的lib目录下的jar包,以解决兼容问题,有的版本默认支持,就不用替换
6、删除原有的jar
[victor@node1 ~]$ rm -rf /opt/module/hbase-1.2.5/lib/hadoop-*
[victor@node1 ~]$ rm -rf /opt/module//hbase-1.2.5/lib/zookeeper-3.4.6.jar
7、 拷贝新jar,涉及的jar有
hadoop-annotations-2.8.2.jar
hadoop-auth-2.8.2.jar
hadoop-client-2.8.2.jar **※**
hadoop-common-2.8.2.jar
hadoop-hdfs-2.8.2.jar
hadoop-mapreduce-client-app-2.8.2.jar
hadoop-mapreduce-client-common-2.8.2.jar
hadoop-mapreduce-client-core-2.8.2.jar
hadoop-mapreduce-client-hs-2.8.2.jar
hadoop-mapreduce-client-hs-plugins-2.8.2.jar
hadoop-mapreduce-client-jobclient-2.8.2.jar
hadoop-mapreduce-client-jobclient-2.8.2-tests.jar
hadoop-mapreduce-client-shuffle-2.8.2.jar
hadoop-yarn-api-2.8.2.jar
hadoop-yarn-applications-distributedshell-2.8.2.jar
hadoop-yarn-applications-unmanaged-am-launcher-2.8.2.jar
hadoop-yarn-client-2.8.2.jar
hadoop-yarn-common-2.8.2.jar
hadoop-yarn-server-applicationhistoryservice-2.8.2.jar
hadoop-yarn-server-common-2.8.2.jar
hadoop-yarn-server-nodemanager-2.8.2.jar
hadoop-yarn-server-resourcemanager-2.8.2.jar
hadoop-yarn-server-tests-2.8.2.jar
hadoop-yarn-server-web-proxy-2.8.2.jar
zookeeper-3.4.10.jar
尖叫提示:这些jar包的对应版本应替换成你目前使用的hadoop版本,具体情况具体分析。
8、查找jar包并拷贝
[victor@node1 ~]$ find /opt/module/hadoop-2.8.2/ -name hadoop-annotations*
尖叫提示:如果有jar包没找到可以通过maven下载后放进去,jar包在window和linux下都可以使用,
不区分环境
9、HBase软连接Hadoop配置
根据情况替换,有些版本不用替换
[victor@node1 ~]$ cd /opt/module/hbase-1.2.5/conf/
[victor@node1 conf]$ ln -s /opt/module/hadoop-2.8.2/etc/hadoop/core-site.xml \
core-site.xml
[victor@node1 conf]$ ln -s /opt/module/hadoop-2.8.2/etc/hadoop/hdfs-site.xml \
hdfs-site.xml
10、HBase远程scp到其它节点上
[victor@node1 module]$ scp -r hbase-1.2.5/ victor@node2:/opt/module/
[victor@node1 module]$ scp -r hbase-1.2.5/ victor@node3:/opt/module/
11、Zookeeper启动
首先保证Zookeeper集群的正常部署,并启动
[victor@node1 zookeeper-3.4.10]$ bin/zkServer.sh start
12、Hadoop启动
Hadoop集群的正常部署并启动
[victor@node1 hadoop-2.8.2]$ sbin/start-dfs.sh
[victor@node1 hadoop-2.8.2]$ sbin/start-yarn.sh
13、HBase启动
启动方式1
[victor@node1 hbase-1.2.5]$ bin/hbase-daemon.sh start master
[victor@node1 hbase-1.2.5]$ bin/hbase-daemon.sh start regionserver
启动方式2
[victor@node1 hbase-1.2.5]$ bin/start-hbase.sh
14、查看HBase页面
启动成功后,可以通过“host:port”的方式来访问HBase管理页面
http://node1:16010
尖叫提示:如果集群之间的节点时间不同步,会导致regionserver无法启动,
抛出ClockOutOfSyncException异常
修复HBase ClockOutOfSyncException异常 方式一
hbase.master.maxclockskew
180000
Time difference of regionserver from master
修复HBase ClockOutOfSyncException异常 方式二
$https://www.jianshu.com/p/930bb81b3eb1