hbase与zk的独立部署(standalone)
2016-06-22 本文已影响878人
_奔跑的蜗牛_
hbase版本:hbase-0.98.20-hadoop2(经测试发现1.*版本以上无法完成standalone部署)
zk:最新版
1、下载并解压habse
2、修改 conf下hbase-env.sh文件,添加下面两行
export HBASE_MANAGES_ZK=false
export JAVA_HOME=/usr/jdk/jdk7
3、修改conf下hbase-site.xml文件,在configuration标签中添加:
<property>
<name>hbase.zookeeper.quorum</name>
<value>localhost</value>
<description>The directory shared by RegionServers.
</description>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/opt/zookeeper-3.4.8/data</value>
<description>Property from ZooKeeper config zoo.cfg.
The directory where the snapshot is stored.
</description>
</property>
<property>
<name>hbase.rootdir</name>
<value>file:///opt/hbase-0.98.20-hadoop2/data</value>
<description>The directory shared by RegionServers.
</description>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
<description>The mode the cluster will be in. Possible values are
false: standalone and pseudo-distributed setups with managed Zookeeper
true: fully-distributed with unmanaged Zookeeper Quorum (see hbase-env.sh)
</description>
</property>
4、测试hbase是否安装ok
添加habse命令软连接到bin中
ln -s /opt/hbase-1.1.5/bin/hbase /usr/local/bin/hbase.sh
ln -s /opt/hbase-0.98.20-hadoop2/bin/hbase-config.sh /usr/local/bin/hbase-config.sh
查看所有表记录
hbase shell
list
注意:hbase.zookeeper.property.dataDir属性值为zk的数据位置
hbase和zookeeper需要在同一台机器