hbase伪分布式安装
伪分布式安装 采用一台hadoop机器,一台hbase机器实现伪分布式
hbase版本为2.2.2
192.168.21.152 上安装hadoop
192.168.21.153 上安装hbase
1 hadoop伪分布式安装
详见 https://www.cnblogs.com/hzcjd/p/13669270.html
2 解压安装包
cd /usr/local/software
tar zxvf hbase-2.2.2-bin.tar.gz -C /usr/local
3 免密登录
配置192.168.21.152 |
配置192.168.21.153 |
ssh-keygen -t rsa cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys |
|
ssh-copy-id root@192.168.21.153
|
ssh-copy-id root@192.168.21.152
|
4 hosts配置
cd /etc vim hosts 192.168.21.153 hb 192.168.21.152 ha :wq
5 hostname配置
cd /etc
vim hostname
hb
:wq
若不配置,当运行hbase的api卡在createTable
6 配置修改
hbase-env.sh
cd /usr/local/hbase-2.2.2/conf vim hbase-env.sh 输入 export JAVA_HOME=/usr/local/jdk :wq
Regionservers
vim regionservers
输入
hb
:wq
hbase-site.xml
cd /usr/local/hbase-2.2.2/conf vim hbase-site.xml configuration中新增 <property> <name>hbase.rootdir</name> <value>hdfs://ha:9000/hbase</value> </property> <!--配置HBase在HDFS中数据备份的个数--> <property> <name>dfs.replication</name> <value>1</value> </property> <!--配置HBase集群分布式模式--> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> <!--配置HBase的zookeeper地址--> <property> <name>hbase.zookeeper.quorum</name> <value>hb</value> </property> <!--配置HBase的zookeeper数据存放路径--> <property> <name>hbase.zookeeper.property.dataDir</name> <value>/home/zk</value> </property>
7 环境变量
vim /etc/profile export HBASE_HOME=/usr/local/hbase-2.2.2 path=HBASE_HOME/bin
8启动
cd /usr/local/hbase-2.2.2/bin
./start-hbase.sh
访问网址:http://192.168.21.153:16010/
9 进入cli
cd /usr/local/hbase-2.2.2/bin
./hbase shell
相关jar包下载
hbase-2.2.2-bin.tar.gz:https://download.csdn.net/download/qq_31552723/13033766