Hbase 环境搭建
Hbase 单机模式(Standalone )
官网下载 hbase 包
解压到指定目录
$ tar xzvf hbase-3.0.0-SNAPSHOT-bin.tar.gz
$ cd hbase-3.0.0-SNAPSHOT
在conf目录下
配置文件如下
配置hbase-env.sh中配置 JAVA_HOME
配置 hbase-site.xml
<configuration>
<property>
<name>hbase.rootdir</name>
<value>file:///usr/local/software/tmp/hbase</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/usr/local/software/tmp/zookeeper</value>
</property>
<property>
<name>hbase.unsafe.stream.capability.enforce</name>
<value>false</value>
<description>
Controls whether HBase will check for stream capabilities (hflush/hsync).
Disable this if you intend to run on LocalFileSystem, denoted by a rootdir
with the 'file://' scheme, but be mindful of the NOTE below.
WARNING: Setting this to false blinds you to potential data loss and
inconsistent system state in the event of process and/or node failures. If
HBase is complaining of an inability to use hsync or hflush it's most
likely not a false positive.
</description>
</property>
</configuration>
启动 bin 目录
启动服务 start-hbase.sh
关闭服务 stop-hbase.sh
Hbase 集群模式
配置hbase-env.sh中配置JAVA_HOME和export HBASE_MANAGES_ZK=false
配置hbase-site.xml
<property>
<name>hbase.rootdir</name>
<value>hdfs://chenkl/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>node1,node2,node3</value>
</property>
配置reginservers,数据节点
vim reginservers
$ node1
$ node2
$ node3
在hbase-env.sh配置 export HBASE_CLASSPATH=/home/hadoop-2.5.1/etc/hadoop/,这里是hadoop配置文件的路径
配置完成,分发到其他节点
需要的话配置环境变量