Ubuntu18.04 部署Hbase
1. Hbase 安装
下载地址:http://hbase.apache.org/downloads.html
1.1 安装Hbase
解压 hbase-2.1.3-bin.tar.gz 到 /opt 目录
sudo tar -zxvf hbase-2.1.3-bin.tar.gz /opt
sudo mv /opt/hbase-2.1.3 /opt/hbase
sudo chown -R hadoop:hadoop /opt/hbase
修改环境变量
sudo gedit /etc/profile
export HBASE_HOME=/opt/hbase
export PATH=$HBASE_HOME/bin:$PATH
刷新环境变量
source /etc/profile
1.2 配置Hbase
1.2.2 配置 hbase-env.sh
cd /opt/hbase/conf
添加如下内容
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export HBASE_MANAGES_ZK=false
1.2.3 配置 hbase-site.xml
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://master:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>master,slave1,slave2</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/data/zookeeper/data</value>
</property>
</configuration>
出现如下异常
java.lang.IllegalStateException: The procedure WAL relies on the ability to hsync for proper operation during component failures, but the underlying filesystem does not support doing so. Please check the config value of ‘hbase.procedure.store.wal.use.hsync’ to set the desired level of robustness and ensure the config value of ‘hbase.wal.dir’ points to a FileSystem mount that can provide it.
hbase-site.xml增加配置
<property>
<name>hbase.unsafe.stream.capability.enforce</name>
<value>false</value>
</property>
1.2.4 配置 regionservers
slave1
slave2
2.1 启动Hbase
cd /opt/hbase/bin
./bin/start-hbase.sh