Hadoop学习之第六章节:Hbase配置安装
1.安装Hbase
1)下载,注意要与hadoop版本兼容,且选择稳定版较好
wget http://mirrors.hust.edu.cn/apache/hbase/hbase-0.98.5/hbase-0.98.5-hadoop2-bin.tar.gz
2)解压
tar -zxvf hbase-0.98.5-hadoop2-bin.tar.gz
3)修改conf/hbase-site.xml文件
hbase.rootdir hdfs://MasterServer:9000/hbase hbase.cluster.distributed true hbase.master hdfs://MasterServer:60000 hbase.zookeeper.quorum hadoop1,hadoop2,hadoop3
4)修改conf/regionservers文件
MasterServer
SlaveServer
注:如果不想将MasterServer作为HRegionServer,就去掉MasterServer
5)修改conf/hbase-env.sh文件
export JAVA_HOME=/usr/lib/jvm/jdk1.6/jdk1.6.0_27
export HBASE_MANAGES_ZK=false #启动指定的ZooKeeper,而非自带的ZooKeeper。
export HBASE_HOME=/home/hadooper/hadoop/hbase-0.98.5
export HADOOP_HOME=/home/hadooper/hadoop/hadoop-2.5.1
4.将配置好的hbase复制到其它节点
scp -r hbase-0.98.5 hadooper@SlaveServer:~/hadoop/
5.进入hbase shell
bin/hbase shell
HBase Shell; enter 'help
Type "exit
Version 0.98.5-hadoop2, rUnknown, Mon Aug 4 23:58:06 PDT 2014
查看集群状态
hbase(main):001:0> status
建表测试
hbase(main):002:0> create 'test','id'0 row(s) in 1.3530 seconds=> Hbase::Table - testhbase(main):003:0> listTABLE member test 2 row(s) in 0.0430 seconds=> ["member", "test"]