apache 大数据平台搭建(hbase)
一.官网下载hbase安装包
https://dlcdn.apache.org/hbase/2.3.7/hbase-2.3.7-bin.tar.gz
二.安装hbase
- zookeeper已部署并启动
- hadoop已部署并启动
- 解压hbase
tar -zxvf hbase-2.3.7-bin.tar.gz -C /opt/module
- 修改配置文件
1)hbase-env.sh 修改内容:
export JAVA_HOME=/opt/module/jdk1.8.0_212
export HBASE_MANAGES_ZK=false
2)hbase-site.xml 修改内容:
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://hadoop101:8020/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.tmp.dir</name>
<value>./tmp</value>
</property>
<property>
<name>hbase.master.port</name>
<value>60020</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>hadoop102,hadoop103,hadoop101</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/opt/module/zookeeper-3.5.7/zkData</value>
</property>
<property>
<name>hbase.unsafe.stream.capability.enforce</name>
<value>false</value>
</property>
</configuration>
3)regionservers:
hadoop102
hadoop103
hadoop101
4)软连接 hadoop 配置文件到 HBase:
ln -s /opt/module/hadoop-3.1.3/etc/hadoop/core-site.xml /opt/module/hbase-2.3.7/conf/core-site.xml
ln -s /opt/module/hadoop-3.1.3/etc/hadoop/hdfs-site.xml /opt/module/hbase-2.3.7/conf/hdfs-site.xml
-
分发安装包
xsync.sh /opt/module/hbase-2.3.7 -
启动服务
编写一键启停脚本:
vim hbase.sh
#!/bin/bash
if [ $# -lt 1 ]
then
echo "No Args Input..."
exit ;
fi
case $1 in
"start")
echo " =================== 启动 hbase集群 ==================="
ssh hadoop101 "/opt/module/hbase-2.3.7/bin/start-hbase.sh"
;;
"stop")
echo " =================== 关闭 hbase集群 ==================="
ssh hadoop101 "/opt/module/hbase-2.3.7/bin/stop-hbase.sh"
;;
"status")
echo " =================== 查看 hbase集群 ==================="
ssh hadoop101 "echo 'status' | /opt/module/hbase-2.3.7/bin/hbase shell | grep masters"
;;
*)
echo "Input Args Error..."
;;
esac
# 启动集群
hbase.sh start
查看集群状态:
到此安装结束.
每个人都在奋不顾身,都在加倍努力,得过且过只会让你和别人的差距越来越大...