HBase 1.2.5 集群安装

安装HBase

tar -zxvf hbase-1.2.5.tar.gz  

配置环境变量

cd hbase-1.2.5

vi conf/hbase-env.sh:

export HBASE_MANAGES_ZK=false   # 禁止Hbase管理zookeeper,意味着你要先手动启动zookeeper集群
export JAVA_HOME=/opt/jdk1.8.0_131

HBase配置文件

vi conf/hbase-site.xml:

<configuration>
 <property>
  <name>hbase.cluster.distributed</name>
  <value>true</value>
</property>

<property>
    <name>hbase.rootdir</name>
    <value>hdfs://mycluster/hbase</value>
  </property>

<property>
  <name>hbase.zookeeper.quorum</name>
  <value>c7003:2181,c7004:2181,c7005:2181</value>
</property>
</configuration>

mycluster是你的Hadoop集群名称

vi conf/regionservers:

c7001
c7002
c7003

vi conf/backup-masters:

c7003

启动HBase集群

bin/start-hbase.sh

访问 http://c7001:16010/ 可以查看hbase集群信息

如果需要停止集群,执行bin/stop-hbase.sh

验证集群

bin/hbase shell
list
create 'test', 'cf'
list 'test'
put 'test', 'row1', 'cf:a', 'value1'
put 'test', 'row2', 'cf:b', 'value2'
put 'test', 'row3', 'cf:c', 'value3'
put 'test', 'row4', 'cf:d', 'value4'
scan 'test'
get 'test', 'row1'
disable 'test'
enable 'test'

如果HBase启动报错,检查你是否已经有其他zookeeper在运行或者zookeeper是否正常工作。

查看HDFS里的hbase目录内容:

hdfs dfs -ls /hbase

 

转载于:https://my.oschina.net/u/3430873/blog/884018

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值