1、单机模式搭建
1.1、下载 http://archive.apache.org/dist/hbase/2.1.3/
1.2、自带zookeeper-3.4.13
1.3、配置hbase环境变量
vim /etc/profile
export HBASE_HOME=/usr/local/big_data/hbase/hbase/hbase-2.1.3
PATH=$ZOOKEEPER_HOME/bin:$JAVA_HOME/bin:$HBASE_HOME/bin:$HADOOP_HOME/bin
source /etc/profile
.............省了
2、伪分布式模式
2.1、vim hbase-env.sh
export JAVA_HOME=/usr/local/jdk1.8.0_172
export HBASE_PID_DIR=/usr/local/big_data/hbase/hbase/pids
export HBASE_MANAGES_ZK=false
2.2、vim conf/hbase-site.xml
<!--hdfs url -->
<property>
<name>hbase.rootdir</name>
<value>hdfs://ip:9000/hbase</value>
</property>
<!--是否分布式 -->
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<!-- zk地址-->
<property>
<name>hbase.zookeeper.quorum</name>
<value>ip:2188</value>
</property>
<property>
<name>hbase.master.info.port</name>
<value>16011</value>
</property>
<property>
<name>hbase.unsafe.stream.capability.enforce</name>
<value>false</value>
</property>
<property>
<name>hbase.tmp.dir</name>
<value>/usr/local/big_data/hbase/hbase/tmp</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/usr/local/big_data/hbase/hbase/tmp/zookeeper</value>
</property>
</configuration>
启动:
./bin/start-hbase.sh
访问:
------------------------------------------------------------------------安装问题------------------------------------------------------------------------
1、安装出现类找不到
java.lang.NoClassDefFoundError: org/apache/htrace/SamplerBuilder
复制 hbase-2.1.3/lib/client-facing-thirdparty/htrace-core-3.1.0-incubating.jar到
hbase-2.1.3/lib目录下
2、出现以下异常:
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>
官方安装: