HBase installation configuration, using independent zookeeper

Keywords: Big Data HBase Zookeeper xml Hadoop

1.HBase installation configuration, using independent zookeeper

2. Modify environment variables:
The first machine is planned to be master, the second machine is RegionServer, and then start RegionServer on the first machine
Make a cluster
1 master
2 RegionServer

Execute vi /etc/profile on the machine, and add the following:
export HBASE_HOME=/usr/local/src/hbase

3. Modify the configuration file:

vi  /hbase/conf/hbase-site.xml 
#Host and port of hbasemaster
#Allowable time difference of time synchronization
#Shared directory, persistent hbase data
#hdfs://hostip2:9000 is the built hdfs
 #Distributed operation or not, false is stand-alone
#zookeeper address
#The location of the snapshot of the configuration information of zookeeper. The file that keeps the information of zookeeper is / tmp by default, which will be lost after restarting
#2181 is the clientPort of zookeeper

vi /hbase/conf/hbase-env.sh

export JAVA_HOME=/usr/java/jdk1.7.0_45   //jdk installation directory
export HBASE_CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar  //Location of hadoop configuration file
export HBASE_MANAGES_ZK=false   #If you use the independently installed zookeeper, this place is false, and the built-in setting is true

vi /conf/regionservers


4. Put hdfs-site.xml and core-site.xml of Hadoop under hbase/conf:


    <!-- Appoint HDFS Number of copies -->


        <!-- Appoint hadoop Storage directory where files are generated at run time -->

5. Send hbase directory to other machines and start master and regionserver respectively

./hbase-daemon.sh start master

./hbase-daemon.sh start regionserver

6. View the webpage: http://hostip2:16010/

Process view jps

3201 Main
9092 HRegionServer
29125 HMaster
13240 Jps
16012 DataNode
12766 ZooKeeperMain

7. View by zookeeper
. / zkCli.sh connect

[zk: localhost:2181(CONNECTED) 1] ls /
[zookeeper, hbase]

[zk: localhost:2181(CONNECTED) 2] ls /hbase
[replication, meta-region-server, rs, splitWAL, backup-masters, 
table-lock, flush-table-proc, region-in-transition, online-snapshot, 
master, running, recovering-regions, draining, namespace, hbaseid, table]

[zk: localhost:2181(CONNECTED) 5] ls /hbase/rs
[host1,16020,1543922854774, host2,16201,1543834531685]

8, expand 1
If you want to start a dual master, hbase-day.sh start master cannot, because hbase-site.xml has written

#Host and port of hbasemaster

You need to use / HBase / bin >. / local master backup.sh start 2

zk view

[zk: localhost:2181(CONNECTED) 26] ls /hbase/backup-masters

Posted by vadercole on Tue, 03 Dec 2019 01:49:01 -0800