wget https://www.apache.org/dyn/closer.lua/hbase/2.0.5/hbase-2.0.5-bin.tar.gz
- 下载文件
wget http://mirror.bit.edu.cn/apache/hbase/2.0.5/hbase-2.0.5-bin.tar.gz
注意https://www.apache.org/dyn/closer.lua/hbase/2.0.5/hbase-2.0.5-bin.tar.gz 下载的是html,不是tar.gz文件
- 解压安装包
tar -zxvf hbase-2.0.5-bin.tar.gz
- 重命名文件夹
mv hbase-2.0.5 hbase
- 配置环境变量
vim /etc/profile
------
export HBASE_HOME=/usr/local/src/hbase
export PATH=$PATH:$JAVA_HOME/bin:/usr/local/src/hadoop/bin:$HBASE_HOME/bin
export HBASE_MANAGES_ZK=true
- 查看HBase版本,确定hbase安装成功
root@503ae25fe58d:/usr/local/src/hbase/conf# hbase version
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/src/hbase/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/src/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
HBase 2.0.5
Source code repository git://dd7c519a402b/opt/hbase-rm/output/hbase revision=76458dd074df17520ad451ded198cd832138e929
Compiled by hbase-rm on Mon Mar 18 00:41:49 UTC 2019
From source with checksum fd9cba949d65fd3bca4df155254ac28c
- conf的hbase-site.xml
在启动HBase前需要设置属性hbase.rootdir,用于指定HBase数据的存储位置,
默认为/tmp/hbase-${user.name},这意味着每次重启系统都会丢失数据。
此处设置为HBase安装目录下的hbase-tmp文件夹即(/usr/local/hbase/hbase-tmp),添加配置如下:
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://localhost:9000/hbase</value>
</property>
<!--指定HBase数据的存储位置 -->
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
</configuration>
- hbase-env.sh添加java环境变量
export JAVA_HOME=/usr/local/src/jdk/jdk1.8
网友评论