Detailed explanation of hbase-0.94 installation method, hbase-0.94 Installation Method

Source: Internet
Author: User

Detailed explanation of hbase-0.94 installation method, hbase-0.94 Installation Method

Prerequisites:
1) in the java environment, java 1.6 or later must be installed.
2) In the hadoop environment, because the HBase architecture is based on other file storage systems, it is necessary to install Hadoop in distributed mode. However, if you are running in unit price mode, this condition can be omitted. Hadoop-1.2.1 Installation Method reference hadoop-1.2.1 Installation Method
Note: Pay attention to the version relationship between Hadoop and HBase during installation. if the version does not match, it may affect the stability of the HBase system.


This post tutorial uses hadoop is hadoop-1.2.1, hbase uses hbase-0.94

Hbase has three installation modes:
Standalone Mode
Pseudo Distribution Mode
Full Distribution Mode

Installation Steps in standalone mode:
1. Upload and decompress hbase-0.94.16-security.tar.gz
[Hadoop @ mdw temp] $ cp/mnt/cdrom/hbase-0.94.16-security.tar.gz.
[Hadoop @ mdw temp] $ tar xzf hbase-0.94.16-security.tar.gz

2. Modify the hbase-env.sh configuration file
Open the/home/hadoop/hbase-0.94.16-security/conf/hbase-env.sh file and add or modify JAVA_HOME Environment Variables
Export JAVA_HOME =/usr/java/jdk1.6.0 _ 45

Modify the HBASE_HEAPSIZE configuration. The default value is 1000. (If the memory size is large, you can leave it unspecified. Set it based on your memory)
Export HBASE_HEAPSIZE = 50

3. Modify the hbase-site.xml file and configure hbase. rootdir
<Property>
<Name> hbase. rootdir </name>
<Value> file: // home/hadoop/hbase/data </value>
</Property>

The path can be any path with the permission to read and write. You need to create the path and change the owner to a hadoop user. The path is stored in the hbase/data directory under the hadoop user directory.

4. Start and verify Hbase
Start hbase
[Hadoop @ mdw ~] $ Hbase-0.94.16-security/bin/start-hbase.sh
Starting master, logging to/home/hadoop/hbase-0.94.16-security/bin/../logs/hbase-hadoop-master-mdw.out

After the startup, you can see an additional HMaster process through jps.
[Hadoop @ mdw ~] $ Jps
2541 NameNode
4236 HMaster
Jps 4430
2687 SecondaryNameNode
2773 JobTracker

Access hbase
[Hadoop @ mdw ~] $ Hbase-0.94.16-security/bin/hbase shell
HBase Shell; enter 'help <RETURN> 'for list of supported commands.
Type "exit <RETURN>" to leave the HBase Shell
Version 0.94.16, r1557241, Fri Jan 10 20:10:24, UTC 2014

Hbase (main): 001: 0> quit

[Hadoop @ mdw ~] $

The hbase standalone mode has been installed successfully.

Installation in pseudo distribution mode:
In pseudo-distribution mode, the configuration is modified based on the standalone mode.
1. Stop hbase installed in standalone mode first
[Hadoop @ mdw ~] $ Hbase-0.94.16-security/bin/stop-hbase.sh

Stopping hbase ..............

2. Modify the hbase-env.sh configuration file
Open the/home/hadoop/hbase-0.94.16-security/conf/hbase-env.sh file and add or modify HBASE_CLASSPATH environment variables so that hbase can locate hadoop

Export HBASE_CLASSPATH =/home/hadoop/hadoop-1.2.1/conf.
Set zookeeper to be managed by hbase. No separate zookeeper is required.
Export HBASE_MANAGES_ZK = true

3. Modify the hbase-site.xml configuration file, modify the hbase. rootdir parameter, and add the hbase. cluster. distributed Parameter to open the distribution mode.
<Property>
<Name> hbase. rootdir </name>
<Value> hdfs: // master: 9000/hbase </value>
</Property>
<Property>
<Name> hbase. cluster. distributed </name>
<Value> true </value>
</Property>


4. Replace the hadoop jar file to prevent hmaster startup exceptions due to compatibility issues between hbase and hadoop versions.
[Hadoop @ mdw lib] $ pwd
/Home/hadoop/hbase-0.94.16-security/lib
Back up the hadoop-core file that comes with hbase, and copy the hadoop-core file under the hadoop installation directory to the lib of hbase.
[Hadoop @ mdw lib] $ mv hadoop-core-1.0.4.jar hadoop-core-1.0.4.bak
[Hadoop @ mdw lib] $ cp ~ /Hadoop-1.2.1/hadoop-core-1.2.1.jar.
[Hadoop @ mdw lib] $ ll hadoop-core *
-Rw-r -- 1 hadoop 3929148 Jan 10 2014 hadoop-core-1.0.4.bak
-Rw-r -- 1 hadoop 4203147 Jun 1 hadoop-core-1.2.1.jar


5. Start and verify hbase
Start hbase
[Hadoop @ mdw ~] $ Hbase-0.94.16-security/bin/start-hbase.sh
Localhost: starting zookeeper, logging to/home/hadoop/hbase-0.94.16-security/bin/../logs/hbase-hadoop-zookeeper-mdw.out
Starting master, logging to/home/hadoop/hbase-0.94.16-security/bin/../logs/hbase-hadoop-master-mdw.out
Localhost: starting regionserver, logging to/home/hadoop/hbase-0.94.16-security/bin/../logs/hbase-hadoop-regionserver-mdw.out

The jps command shows that the HRegionServer process and HQuorumPeer process are more than those in standalone mode.
[Hadoop @ mdw ~] $ Jps
2541 NameNode
5552 HRegionServer
5404 HMaster
2687 SecondaryNameNode
2773 JobTracker
5293 HQuorumPeer
Jps 5681

Access hbase and view its status
[Hadoop @ mdw ~] $ Hbase-0.94.16-security/bin/hbase shell
HBase Shell; enter 'help <RETURN> 'for list of supported commands.
Type "exit <RETURN>" to leave the HBase Shell
Version 0.94.16, r1557241, Fri Jan 10 20:10:24, UTC 2014

Hbase (main): 001: 0> status
1 servers, 0 deactive, 2.0000 average load

Hbase (main): 002: 0> exit
[Hadoop @ mdw ~] $


Run the hadoop dfs command to view the hadoop file system. An hbase folder is added to the root directory of the hadoop file system.
[Hadoop @ mdw ~] $ Hadoop dfs-ls/
Found 3 items
Drwxr-xr-x-hadoop supergroup 0/hbase
Drwxr-xr-x-hadoop supergroup 0 2015-05-27 02-14/home
Drwxr-xr-x-hadoop supergroup 0 2015-05-29 0:31/user
[Hadoop @ mdw ~] $ Hadoop dfs-ls/hbase
Found 7 items
Drwxr-xr-x-hadoop supergroup 0/hbase/-ROOT-
Drwxr-xr-x-hadoop supergroup 0/hbase/. META.
Drwxr-xr-x-hadoop supergroup 0 2015-06-01 0:06/hbase/. logs
Drwxr-xr-x-hadoop supergroup 0/hbase/. oldlogs
Drwxr-xr-x-hadoop supergroup 0 2015-06-01 0:06/hbase/. tmp
-Rw-r -- 2 hadoop supergroup 38 2015-06-01 0:06/hbase. id
-Rw-r -- 2 hadoop supergroup 3/hbase. version


So far, hbase in distributed mode has been installed successfully.

Installation in full distribution mode:
The full distribution mode modifies the corresponding configuration based on the pseudo distribution mode.

1. Stop hbase
[Hadoop @ mdw ~] $ Hbase-0.94.16-security/bin/stop-hbase.sh
Stopping hbase ...........
Localhost: stopping zookeeper.


2. Clear the/hbase file directory in the hdfs File System
[Hadoop @ mdw ~] $ Hadoop dfs-rmr/hbase
Deleted hdfs: // master: 9000/hbase


3. Modify the hbase-site.xml configuration file and add zookeeper-related configuration
<Property>
<Name> hbase. zookeeper. quorum </name>
<Value> sdw1, sdw2 </value>
</Property>
<Property>
<Name> hbase. zookeeper. property. dataDir </name>
<Value>/home/hadoop/tmp/zookeeper </value>
</Property>


4. Modify the regionservers file and add the host names or IP addresses of all Region servers,
[Hadoop @ mdw conf] $ cat regionservers
Sdw1
Sdw2


5. Start and verify hbase
[Hadoop @ mdw ~] $ Hbase-0.94.16-security/bin/start-hbase.sh
Sdw2: starting zookeeper, logging to/home/hadoop/hbase-0.94.16-security/bin/../logs/hbase-hadoop-zookeeper-sdw2.out
Sdw1: starting zookeeper, logging to/home/hadoop/hbase-0.94.16-security/bin/../logs/hbase-hadoop-zookeeper-sdw1.out
Starting master, logging to/home/hadoop/hbase-0.94.16-security/logs/hbase-hadoop-master-mdw.out
Sdw1: starting regionserver, logging to/home/hadoop/hbase-0.94.16-security/bin/../logs/hbase-hadoop-regionserver-sdw1.out
Sdw2: starting regionserver, logging to/home/hadoop/hbase-0.94.16-security/bin/../logs/hbase-hadoop-regionserver-sdw2.out

[Hadoop @ mdw ~] $ Jps
6890 HMaster
2541 NameNode
Jps 7031
2687 SecondaryNameNode
2773 JobTracker
Processes on sdw1 and sdw2:
[Hadoop @ sdw1 ~] $ Jps
2407 TaskTracker
2340 DataNode
4012 HQuorumPeer
Jps 4229
4079 HRegionServer


Access hbase and view its status
[Hadoop @ mdw ~] $ Hbase-0.94.16-security/bin/hbase shell
HBase Shell; enter 'help <RETURN> 'for list of supported commands.
Type "exit <RETURN>" to leave the HBase Shell
Version 0.94.16, r1557241, Fri Jan 10 20:10:24, UTC 2014

Hbase (main): 001: 0> status
2 servers, 0 deactive, 1.0000 average load

Hbase (main): 002: 0> exit

[Hadoop @ mdw ~] $

6. Configure HBASE_HOME and open. bashrc to add and modify the following content (optional)

export HBASE_HOME=/home/hadoop/hbase-0.94.16-securityexport PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HBASE_HOME/bin



So far, the full distribution mode of hbase has been installed successfully.





Copyright Disclaimer: This article is an original article by the blogger. For more information, see this article.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.