Hbase distributed installation deployment process

Hbase distributed installation deployment process 1, HBase installation

1) Download the installation package

The hbase-090.3.tar.gz version is well compatible with hadoop-1.2.1. Download the hbase-090.3.tar.gz installation package from the official website and copy the downloaded hbase-090.3.tar.gz to the /home/hadoop directory. Hbase official website download address: http://archive.apache.org/dist/hbase/

Select HBase-0.94.20 version and download HBase Releases.

2) Unpack the installation package

[hadoop@K-Master ~]$ cd /usr

[hadoop@K-Master usr]$ sudo tar -xvf /home/hadoop/hbase-090.3.tar.gz #Unpack the installation source package

[hadoop@K-Master usr]$ mv hbase-090.3 hbase #rename

[hadoop@K-Master usr]$ cd hbase

[hadoop@K-Master hbase]$ sudo chown -R hadoop:hadoop hbase #Identify all files in the hbase installation directory.

3) Configure the installation path

# Add the bin directory under hbase to the path of the system, and add the following content to the end of the /etc/profile file.

[hadoop@K-Master usr]$ sudo vim /etc/profile

Export PATH=$PATH:/usr/hbase/bin

# Execute the source command to make the above configuration take effect immediately on the current terminal.

[hadoop@K-Master usr]$ source /etc/profile

4) Verify that the installation was successful

[hadoop@K-Master usr]$ hbase version

14/07/21 18:01:57 INFO uTIl.VersionInfo: HBase 0.94.20

14/07/21 18:01:57 INFO uTIl.VersionInfo: Subversion git://newbunny/home/lars/dev/hbase-0.94 -r 09c60d770f2869ca315910ba0f9a5ee9797b1edc

14/07/21 18:01:57 INFO uTIl.VersionInfo: Compiled by lars on Fri May 23 22:00:41 PDT 2014

Seeing the above print message indicates that Hbase has been successfully installed, and then the Hbase stand-alone mode and pseudo-distributed mode are configured separately.

2, HBase stand-alone mode

1) Configure /conf/hbase-env.sh

Set the JAVA_HOME variable to the root of the Java installation, as shown below:

[hadoop@K-Master hbase]$ vim conf/hbase-env.sh

# Modify the hbase-env.sh file as follows:

Export JAVA_HOME=/usr/java/jdk1.7.0_65 #Configure the java installation root directory of this machine

Export HBASE_MANAGES_ZK=true #Configure zookeeper by hbase itself, no separate zookeeper is required.

2) Configure /conf/hbase-site.xml

Before starting Hbase, you need to set the property hbase.rootdir to specify the storage location of Hbase data. Here, set the hbase-tmp folder in the HBase installation directory (file:///usr/hbase/hbase-tmp). The configuration is as follows:

[hadoop@K-Master hbase]$ vim conf/hbase-site.sh

configuraTIon

"property"

"name" hbase.rootdir "/name"

"value" file:///usr/hbase/hbase-tmp "/value"

"/property"

/configuration

Special note: hbase.rootdir defaults to /tmp/hbase-${user.name}, which means that data is lost each time the system is rebooted.

3) Start Hbase

[hadoop@K-Master hbase]$ start-hbase.sh

Starting master, logging to /usr/hbase/bin/. ./logs/hbase-hadoop-master-K-Master.localdomain.out

4) Enter shell mode

After entering the shell mode, use the status command to view the running status of Hbase and exit the shell with the exit command.

[hadoop@K-Master hbase]$ hbase shell

HBase Shell; enter 'help "RETURN"' for list of supported commands.

Type "exit "RETURN"" to leave the HBase Shell

Version 0.94.20, r09c60d770f2869ca315910ba0f9a5ee9797b1edc, Fri May 23 22:00:41 PDT 2014

Hbase(main):001:0》 status

1 servers, 0 dead, 2.0000 average load

Hbase(main):002:0" exit

5) Stop HBase

[hadoop@K-Master hbase]$ stop-hbase.sh

Stopping hbase

Special Note: If an error occurs during the operation of Hbase, you can check the cause of the error through the log file in the logs subdirectory under the {HBASE_HOME} directory (/usr/hbase).

3, HBase pseudo-distributed mode

1) Configure /conf/hbase-env.sh

Add the variable HBASE_CLASSPATH and set the path to the conf directory under the local Hadoop installation directory (ie {HADOOP_HOME}/conf). After the modification is completed, the configuration of hbase-env.sh is as follows:

[hadoop@K-Master hbase]$ vim conf/hbase-env.sh

Export JAVA_HOME=/usr/java/jdk1.7.0_65

Export HBASE_CLASSPATH=/usr/hadoop/conf

Export HBASE_MANAGES_ZK=true

2) Configure /conf/hbase-site.xml

Change hbase.rootdir to point to the K-Master (consistent with the port of hdfs) and specify the storage path of HBase on HDFS. Set the property hbase.cluter.distributed to true. Assume that the current Hadoop cluster is running in pseudo-distributed mode, and the NameNode is running on port 9000.

[hadoop@K-Master hbase]$ vim hbase-site.xml

Configuration

"property"

"name" hbase.rootdir "/name"

"value" hdfs://K-Master:9000/hbase"/value"

"/property"

"property"

"name" hbase.cluster.distributed "/name"

"value" true "/value"

"/property"

/configuration

3) Start HBase

Start HBase after completing the above operations. Startup sequence: Start Hadoop first - "Start HBase again", close the sequence: close HBase - then close Hadoop.

The first step: start the Hadoop cluster

[hadoop@K-Master hbase]$ start-all.sh #Start hadoop

[hadoop@K-Master hbase]$ jps #View process

9040 DataNode

18205 Jps

9196 SecondaryNameNode

10485 JobTracker

10620 TaskTracker

8902 NameNode

Special Note: Readers can first check whether the Hadoop cluster is started by using the jps command. If the Hadoop cluster is already started, you do not need to perform Hadoop cluster startup.

Step 2: Start HBase

[hadoop@K-Master lib]$ start-hbase.sh #Start Hbase

K-Master: starting zookeeper, logging to /usr/hbase/bin/. ./logs/hbase-hadoop-zookeeper-K-Master.localdomain.out

Starting master, logging to /usr/hbase/bin/. ./logs/hbase-hadoop-master-K-Master.localdomain.out

K-Master: starting regionserver, logging to /usr/hbase/bin/. ./logs/hbase-hadoop-regionserver-K-Master.localdomain.out

[hadoop@K-Master lib]$ jps #View process

9040 DataNode

18889 HMaster

19201 Jps

9196 SecondaryNameNode

19073 HRegionServer

10485 JobTracker

10620 TaskTracker

18818 HQuorumPeer

8902 NameNode

Enter shell mode

After entering the shell mode, use the list command to view all the table information of the current database. Create a member table with the create command. It has three column families: member_id, address, and info. You can view the member table structure through the describe command and exit the HBase shell mode through the exit command. .

[hadoop@K-Master hadoop]$ hbase shell

HBase Shell; enter 'help "RETURN"' for list of supported commands.

Type "exit "RETURN"" to leave the HBase Shell

Version 0.94.20, r09c60d770f2869ca315910ba0f9a5ee9797b1edc, Fri May 23 22:00:41 PDT 2014

Hbase(main):001:0" create 'member','member_id','address','info'

0 row(s) in 2.7170 seconds

Hbase(main):002:0》 list

TABLE

Member

1 row(s) in 0.0550 seconds

Hbase(main):003:0" describe 'member'

DESCRIPTION ENABLED

'member', {NAME =》 'address', DATA_BLOCK_ENCODING = true 》 'NONE', BLOOMFILTER =》 'NONE', REPLICATION_SCOPE

=》 '0', VERSIONS =》 '3', COMPRESSION =》 'NONE', MIN _VERSIONS =》 '0', TTL = " '2147483647', KEEP_DELETED

_CELLS =》 'false', BLOCKSIZE =》 '65536', IN_MEMORY =》 'false', ENCODE_ON_DISK =》 'true', BLOCKCACHE =》

'true'}, {NAME =》 'info', DATA_BLOCK_ENCODING =》 ' NONE', BLOOMFILTER =》 'NONE', REPLICATION_SCOPE =》

'0', VERSIONS =》 '3', COMPRESSION =》 'NONE', MIN_VE RSIONS =》 '0', TTL =》 '2147483647', KEEP_DELETED_CE

LLS = " 'false', BLOCKSIZE = " '65536', IN_MEMORY = " 'false', ENCODE_ON_DISK = " 'true', BLOCKCACHE = " 't

Rue'}, {NAME =》 'member_id', DATA_BLOCK_ENCODING =》 'NONE', BLOOMFILTER =》 'NONE', REPLICATION_SCOPE =

》 '0', VERSIONS =》 '3', COMPRESSION =》 'NONE', MIN_ VERSIONS =》 '0', TTL = " '2147483647', KEEP_DELETED_

CELLS = " 'false', BLOCKSIZE = " '65536', IN_MEMORY = 》 'false', ENCODE_ON_DISK = " 'true', BLOCKCACHE = "

'true'} 1 row(s) in 0.1040 seconds hbase(main):004:0" exit

View HDFS HBase database files

Use the hadoop fs –ls /hbase command to check whether the HBase distributed database is successfully created on HDFS. The /hbase/member folder is the storage location of the member database that we created in the previous step on HDFS.

[hadoop@K-Master conf]$ hadoop fs -ls /hbase

Found 8 items

Drwxr-xr-x - hadoop supergroup 0 2014-07-21 19:46 /hbase/-ROOT-

Drwxr-xr-x - hadoop supergroup 0 2014-07-21 19:46 /hbase/.META.

Drwxr-xr-x - hadoop supergroup 0 2014-07-22 11:38 /hbase/.logs

Drwxr-xr-x - hadoop supergroup 0 2014-07-22 11:39 /hbase/.oldlogs

Drwxr-xr-x - hadoop supergroup 0 2014-07-22 11:40 /hbase/.tmp

-rw-r--r-- 1 hadoop supergroup 38 2014-07-21 19:46 /hbase/hbase.id

-rw-r--r-- 1 hadoop supergroup 3 2014-07-21 19:46 /hbase/hbase.version

Drwxr-xr-x - hadoop supergroup 0 2014-07-22 11:40 /hbase/member

Stop HBase

After completing the above operations, perform the HBase shutdown operation, and close the sequence: close HBase - then turn off Hadoop.

[hadoop@K-Master hadoop]$ stop-hbase.sh #STOPHbase

Stopping hbase

K-Master: stopping zookeeper.

[hadoop@K-Master hadoop]$ stop-all.sh #STOP Hadoop

Stopping jobtracker

K-Master: stopping tasktracker

Stopping namenode

K-Master: stopping datanode

K-Master: stopping secondarynamenode

4, HBase user interface 1) HDFS home page

Enter http://{hostname}:50070/dfshealth.jsp to enter the HDFS homepage. Click the "Browse the filesystem" hyperlink on the homepage and select the hbase directory. You can view the /hbase directory structure generated by HBase on HDFS. Used to store Hbase data, as shown in the following figure;

Hbase distributed installation deployment process

2) Master page

You can view the HBase related information through the address http://{hostname}:60010/master.jsp, as shown in the figure below.

Hbase distributed installation deployment process

Liquid Crystal Display For Clock

Dongguan Yijia Optoelectronics Co., Ltd. , https://www.everbestlcdlcms.com