Hbase 2.2.1 单机版安装教程
系统环境:centos7
软件:jdk-8u151-linux-x64.rpm 、hbase2.2.1
1. 下载hbase-2.2.1到服务器
# 切换到home目录下
cd /home
# 将文件下载至当前目录
wget http://archive.apache.org/dist/hbase/2.2.1/hbase-2.2.1-bin.tar.gz
2. 下载jdk1.8并上传到服务器
下载地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html
安装jdk:
npm -ivh jdk-8u151-linux-x64.rpm
3. 配置hbase环境变量
# 编辑文件
vi /etc/profile
export HBASE_HOME=/home/hbase-2.2.1
export PATH=$PATH:$HBASE_HOME/bin
# 使配置立即生效
source /etc/profile
4. 修改hbase-env.sh文件
# 编辑文件
vi /home/hbase-2.2.1/conf/hbase-env.sh
# 在文件中加入如下内容:
export JAVA_HOME=/home/jdk1.8.0_191
export HBASE_CLASSPATH=/home/hbase-2.2.1/conf
export HBASE_MANAGES_ZK=true
5. 修改hbase-site.xml文件
# 编辑文件
vi /home/hbase-2.2.1/conf/hbase-site.xml
# 在该文件中添加如下内容:
<configuration>
<property>
<name>hbase.rootdir</name>
<value>file:///home/hbase-2.2.1/logs/site</value>
</property>
<property>
<name>hbase.tmp.dir</name>
<value>/home/hbase-2.2.1/tmp</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
# 该处value值填写 本机IP 或 host值
<property>
<name>hbase.zookeeper.quorum</name>
<value>127.0.0.1</value>
</property>
</configuration>
6. 验证hbase是否安装成功
hbase version
7. 启动hbase
cd /home/hbase-2.2.1/bin && ./start-hbase.sh
8. 测试hbase shell
hbase shell
HBase Shell
Use “help” to get list of supported commands.
Use “exit” to quit this interactive shell.
For Reference, please visit: http://hbase.apache.org/2.0/book.html#shell
Version 2.2.1, rf93aaf770cce81caacbf22174dfee2860dbb4810, 2019年 09月 10日 星期二 14:28:27 CST
Took 0.0043 seconds