Chapter 6 of Hadoop Learning: Hbase configuration and installation
1. Install Hbase
1) download, pay attention to be compatible with the hadoop version, and choose the stable version is better.
Wget http://mirrors.hust.edu.cn/apache/hbase/hbase-0.98.5/hbase-0.98.5-hadoop2-bin.tar.gz
2) decompression
Tar-zxvf hbase-0.98.5-hadoop2-bin.tar.gz
3) modify conf/hbase-site.xml file
Hbase.rootdir hdfs://MasterServer:9000/hbase hbase.cluster.distributed true hbase.master hdfs://MasterServer:60000 hbase.zookeeper.quorum hadoop1,hadoop2,hadoop3
4) modify conf/regionservers file
MasterServer
SlaveServer
Note: if you do not want to use MasterServer as a HRegionServer, remove MasterServer
5) modify conf/hbase-env.sh file
Export JAVA_HOME=/usr/lib/jvm/jdk1.6/jdk1.6.0_27
Export HBASE_MANAGES_ZK=false # starts the specified ZooKeeper instead of the native ZooKeeper.
Export HBASE_HOME=/home/hadooper/hadoop/hbase-0.98.5
Export HADOOP_HOME=/home/hadooper/hadoop/hadoop-2.5.1
4. Copy the configured hbase to another node
Scp-r hbase-0.98.5 hadooper@SlaveServer:~/hadoop/
5. Enter hbase shell
Bin/hbase shell
HBase Shell; enter 'help' for list of supported commands.
Type "exit" to leave the HBase Shell
Version 0.98.5-hadoop2, rUnknown, Mon Aug 4 23:58:06 PDT 2014
View cluster status
Hbase (main): 001VR 0 > status
Table building test
Hbase (main): 002 create 0 > test' 'id'0 row (s) in 1.3530 seconds= > Hbase::Table-testhbase (main): 003seconds= 0 > listTABLE member test 2 row (s) in 0.0430 seconds= > ["member" "test"]