Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Hbase configuration and installation

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

HBase configuration installation

Hbase0.98.5 is installed on the rhel6.2 system using hadoop2.2.0.

Download hbase-0.98.5-hadoop2-bin.tar.gz and upload it to the server

Use the command to decompress

[root@master soft] # tar-zxvfhbase-0.98.5-hadoop2-bin.tar.gz

Cp the extracted directory to the specified directory. Currently, the directory under hdtest user home is used.

[root@master soft] # cp hbase-0.98.5-hadoop2/home/hdtest/hbase2/

Modify the hbase2 directory to the group and users

Chown hdtest.hdtest hbase2/-R

Modify 3 configuration files in the conf directory:

1. Hbase-env.sh

Like hadoop-env.sh, this file sets the environment for hbase. The modifications are as follows:

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

Export HBASE_CLASSPATH=/home/hdtest/hadoop-2.2.0/etc/hadoop/

Export HBASE_HEAPSIZE=1000

ExportHBASE_MANAGES_ZK=false

Where HBASE_CLASSPATH points to the directory where the Hadoop configuration file is stored, so that HBase can find the configuration information of HDFS. Since the Hadoop and HBase are deployed on the same physical node, they point to the directory under the Hadoop installation path. The HBASE_HEAPSIZE unit is MB, which can be set as needed and the actual remaining memory. The default is 1000. HBASE_MANAGES_ZK=false instructs HBase to use an existing Zookeeper instead of its own.

2. Hbase-site.xml

This file is the main configuration file for hbase, and the configuration is as follows:

Hbase.rootdir

Hdfs://master:9000/hbase

Hbase.cluster.distributed

True

Hbase.tmp.dir

/ home/hdtest/hbase2

The first item specifies that the file system used by hbase is HDFS and the root directory is hdfs://master:9000/hbase, which should be automatically created by HBase and only need to be specified to the correct HDFS NameNode. The second item specifies that the working mode of HBase is distributed, and the third item specifies that HBase stores the metadata as / home/hdtest/hbase2, which needs to be created on node0 (Master).

3. Regionservers

This file specifies the RegionServers of HBase, which is equivalent to slaves in the hadoop configuration file. In this article, slave1/2 is used as RegionServer, so the content of the file is:

192.168.200.3

192.168.200.4

The HBase configuration is complete and distributed to the same directory on all Master and RegionServer nodes, as shown in

/ home/hdtest/hbase2, and copy the zoo.cfg to the HBASE_CLASSPATH of each node (/ home/hdtest/hadoop-2.2.0/etc/hadoop/) so that HBase can find the configuration of Zookeeper.

First start HDFS on NameNode (node0):

$~ / hadoop-1.0.2/bin/start-dfs.sh

Then start Zookeeper on each node (node1/2/3) of the Zookeeperensemble:

$~ / zookeeper-3.4.3/bin/zkServer.sh start

Start HBase on Master (node0):

$~ / hbase-0.94.0/bin/start-hbase.sh

Use a browser to access:

Http://node0:60010

You can see the operation information of HBase. If there are numbers in Attributes-> Load average, there are-ROOT- in Tables.

And .meta. Both tables, and the information in Region Server is normal, then HBase starts normally.

The order of shutdown is the opposite of the order of startup. Close HBase first:

$~ / hbase-0.94.0/bin/stop-hbase.sh

Then close Zookeeper and HDFS.

Problem solving:

1. Time synchronization problems cause other RegionServers startup errors

2014-10-16 13 regionserver.HRegionServer 01 regionserver.HRegionServer 11956 FATAL [regionserver60020] Master rejected startup becauseclock is out of sync

Org.apache.hadoop.hbase.ClockOutOfSyncException:org.apache.hadoop.hbase.ClockOutOfSyncException: Serverslave2,60020,1413435669437 has been rejected; Reported time is too far out ofsync with master. Time difference of 400025ms > max allowed of 30000ms

At org.apache.hadoop.hbase.master.ServerManager.checkClockSkew (ServerManager.java:344)

Atorg.apache.hadoop.hbase.master.ServerManager.regionServerStartup (ServerManager.java:237)

Atorg.apache.hadoop.hbase.master.HMaster.regionServerStartup (HMaster.java:1286)

Atorg.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos$RegionServerStatusSe

From the error message, we can see that the time is out of sync.

Solution:

You need to configure a ntp server in the cluster (there are plenty of configuration methods on the network), and then after the master node stops all hbase services using stop-hbase.sh to see if the ntp service is in effect, that is, whether the time of the master node and the regionserver node are the same, start the hbase service again.

Use jps to view hbase processes on the master server

[hdtest@master ~] $jps

6930 HMaster

9638 Jps

14932 JournalNode

4120 QuorumPeerMain

15013 NameNode

15345 ResourceManager

A Hamster service is a hbase service.

Journalnode is the service that namenode configures when doing HA.

Quorumpeermain is a service started by zookeeper.

Namenode and resourcemanager are hdfs startup services

View the hbase service on the slave1 node

[hdtest@slave1 ~] $jps

21281 QuorumPeerMain

26528 Jps

11762 JournalNode

11854 NameNode

23557 HRegionServer

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report