hbase完全分布式安装
完全分布式安装 需要一个hadoop集群和hbase集群
为防止服务器宕机导致数据丢失,公司一般采用此模式。如果是个人测试使用,建议安装伪分布式 https://www.cnblogs.com/hzcjd/p/13868391.html
1安装hadoop集群
启动hbase前先得启动hadoop
安装方法见 hadoop完全分布式安装 https://www.cnblogs.com/hzcjd/p/13669423.html
2 部署图
|
NN-1 |
NN-2 |
DN |
ZK |
master |
regionserver |
IP地址 |
Node01 |
* |
|
|
|
* |
|
192.168.21.148 |
Node02 |
|
* |
* |
* |
|
* |
192.168.21.147 |
Node03 |
|
|
* |
* |
|
* |
192.168.21.143 |
Node04 |
|
|
* |
* |
|
* |
192.168.21.146 |
Node05 |
|
|
|
|
* |
|
192.168.21.152 |
带*代表此机器需启动的应用
从上图可见hmaster分别安装在node01和node05机器上
3 解压
cd /usr/local/software
tar zxvf hbase-2.2.2-bin.tar.gz -C /usr/local
4 时间服务器同步
Node01 |
Node02 |
Node03 |
Node04 |
Node05 |
yum install -y ntpdate ntpdate ntp1.aliyun.com |
5 五台机器免登陆设置
配置node01 |
配置node02 |
配置node03 |
配置node04 |
配置node05 |
||||
ssh-keygen -t rsa cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys |
||||||||
ssh-copy-id root@node02 ssh-copy-id root@node03 ssh-copy-id root@node04 ssh-copy-id root@node05 |
… |
… |
ssh-copy-id root@node01 ssh-copy-id root@node02 ssh-copy-id root@node03 ssh-copy-id root@node05 |
ssh-copy-id root@node01 ssh-copy-id root@node02 ssh-copy-id root@node03 ssh-copy-id root@node04
|
6 环境变量
Node01 |
Node02 |
Node03 |
Node04 |
Node05 |
vim /etc/profile export HBASE_HOME=/usr/local/hbase-2.2.2 path=HBASE_HOME/bin |
7 配置修改160010
hbase-env.sh
cd /usr/local/hbase-2.2.2/conf vim hbase-env.sh 输入 export JAVA_HOME=/usr/local/jdk export HBASE_MANAGES_ZK=false :wq
hbase-site.xml
<property> <name>hbase.rootdir</name> <value>hdfs://mycluster:8020/hbase</value> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>node02,node03,node04</value> </property> <property> <name>hbase.unsafe.stream.capability.enforce</name> <value>false</value> </property>
hdfs://mycluster:8020/hbase 与hadoop中的hdfs.site一致
Regionservers
vim regionservers
输入
node02
node03
node04
:wq
Backup-masters
vim backup-masters输入
node05
:wq
拷贝hdfs.xml
cp /usr/local/hadoop-3.2.0-ha/etc/hadoop/hdfs-site.xml ./
分发
Node02 |
Node03 |
Node04 |
Node05 |
cd /usr/local scp -r hbase-2.2.2 node02:`pwd` scp -r hbase-2.2.2 node03:`pwd` scp -r hbase-2.2.2 node04:`pwd` scp -r hbase-2.2.2 node05:`pwd` |
8 hostname配置
Node01 |
Node02 |
Node03 |
Node04 |
Node05 |
cd /etc |
cd /etc |
cd /etc |
cd /etc |
cd /etc |
9启动
cd /usr/local/hbase-2.2.2/bin
./start-hbase.sh
访问网址:
http://192.168.21.148:16010/
11 cli
cd /usr/local/hbase-2.2.2/bin
./hbase shell
相关安装包下载
hbase-2.2.2-bin.tar.gz https://download.csdn.net/download/qq_31552723/13033766