Hbase is a subproject of hadoop. Download the appropriate Hbase version here. Note: versions of Hadoop and Hbase cannot be used randomly. Therefore, you must first understand whether or not to match and then proceed.
Hbase is a subproject of hadoop. Download the appropriate Hbase version here. Note: versions of Hadoop and Hbase cannot be used randomly. Therefore, you must first understand whether or not to match and then proceed.
1. Hbase is a subproject of Hadoop. Download the appropriate Hbase version here. Note: versions of Hadoop and Hbase cannot be used randomly. Therefore, you need to know whether to work together before deploying the service. Otherwise, it will be a waste of time. Here we use hadoop 0.20.2 and Hbase 0.20.6. The hadoop configuration is shown in my previous blog, if you need to configure hadoop, read the article and configure Hbase. The configuration steps are as follows: hadoop first and hbase later.
2. Decompress Hbase. Specific command: tar-zxvf hbase-0.20.6.tar.gz
3. Modify the hbase-site.xml, hbase-env.sh, regionservers file under the conf directory. Looks like the configuration does not use hbase-default.xml, ignore it.
Hbase-site.xml
Hbase. rootdir
Hdfs: /// hadoopserver-1: 9000/hbase
Hbase. cluster. distributed
True
Hbase. master. port
60000
Hbase. zookeeper. quorum
Hadoopserver-1
Hbase. zookeeper. property. dataDir
/Home/hadoopuser/data/zookeeper
Explanation:
Hbase. rootdir sets the directory of hbase on hdfs. The host name is the host where the namenode node of hdfs is located.
Hbase. cluster. distributed is set to true, indicating that it is a fully distributed hbase cluster.
Hbase. master sets the master host name and port of hbase.
Hbase. zookeeper. quorum sets the zookeeper host. We recommend that you use the singular number.
Then add the following configuration in the hbase-env.sh:
Export JAVA_HOME =/usr/local/jdk1.6.0 _ 22/
Export HBASE_LOG_DIR =/home/hadoopuser/logs/hbase
Export HBASE_MANAGES_ZK = true
If you want Hbase to manage zookeeper by itself, HBASE_MANAGES_ZK must be set to true, so you do not need to manually start zookeeper because Hbase integrates zookeeper. (PS: in fact, we can define a group of zookeeper clusters to coordinate Hbase. Here we should first use the zookeeper that comes with Hbase to save trouble .)
Modify the regionservers File
Add all datanode to this file, similar to the slaves file in hadoop.
4. After the configuration is complete, start Hbase.
$ Bin/start-hbase.sh --- start hbase
$ Bin/hbase shell --- enter hbase and operate it in shell mode