Hbase 配置多master节点

环境描述

正常运行一套hadoop-3.0.0集群,hbase配置,一个Hmaster,两个Hregionserver;

运行大数据计算时候,hbase的Hmaster容易因为内存资源问题自动退出;

需要配置多个Hmaster,多个Hregionserver;

功能需求

根据需求,部署hadoop-3.0.0基础功能架构,以六节点为安装环境,操作系统CentOS 7 x64;

openstack创建三台虚拟机,开始部署;

IP地址

主机名

10.10.204.31

master

10.10.204.32

slave1

10.10.204.33

slave2

10.10.204.34

datanode1

10.10.204.35

datanode2

10.10.204.36

datanode3

功能节点规划

master

slave1

slave2

datanode1

datanode2

datanode3

NameNode

         
     

DataNode

DataNode

DataNode

JournalNode

JournalNode

JournalNode

     

zookeeper

zookeeper

zookeeper

     

kafka

kafka

kafka

     
     

NodeManager

NodeManager

NodeManager

 

ResourceManager

ResourceManager

     

HMaster

HRegionServer

HRegionServer

HRegionServer

HRegionServer

HRegionServer

Hive

Hive

Hive

     

配置记录

1.修改hbase配置文件;

hbase-site.xml

 

hbase.cluster.distributed

true

hbase.rootdir

hdfs://vhcluster/hbase

hbase.zookeeper.quorum

master,slave1,slave2

hbase.zookeeper.property.clientPort

2181

       zookeeper.znode.parent

       /hbase

    

hbase.master.info.port

16010

hbase.regionserver.info.port

16030

hbase.unsafe.stream.capability.enforce

false

hbase.superuser

hbase

hbase.coprocessor.region.classes

org.apache.hadoop.hbase.security.access.AccessController

hbase.coprocessor.master.classes

org.apache.hadoop.hbase.security.access.AccessController

hbase.rpc.engine

org.apache.hadoop.hbase.ipc.SecureRpcEngine

hbase.security.authorization

true

 

regionservers

slave1

slave2

datanode1

datanode2

datanode3

启动hbase服务

master

cd /opt/modules/hadoop-3.0.0/hbase-2.0.4

./bin/start-hbase.sh

 

slave1

cd /opt/modules/hadoop-3.0.0/hbase-2.0.4

./bin/hbase-daemon.sh start master

 

slave2

cd /opt/modules/hadoop-3.0.0/hbase-2.0.4

./bin/hbase-daemon.sh start master

#如何确定哪个Hmaster节点为主,直接通过查看日志方式即可;

[root@slave1 logs]# tail hbase-root-master-slave1.log

2019-04-03 10:06:19,460 INFO [main] server.Server: jetty-9.3.19.v20170502

2019-04-03 10:06:19,500 INFO [main] handler.ContextHandler: Started o.e.j.s.ServletContextHandler@1a891add{/logs,file:///opt/modules/hadoop-3.0.0/hbase-2.0.4/logs/,AVAILABLE}

2019-04-03 10:06:19,500 INFO [main] handler.ContextHandler: Started o.e.j.s.ServletContextHandler@373f7450{/static,file:///opt/modules/hadoop-3.0.0/hbase-2.0.4/hbase-webapps/static/,AVAILABLE}

2019-04-03 10:06:19,611 INFO [main] handler.ContextHandler: Started o.e.j.w.WebAppContext@cbc8d0f{/,file:///opt/modules/hadoop-3.0.0/hbase-2.0.4/hbase-webapps/master/,AVAILABLE}{file:/opt/modules/hadoop-3.0.0/hbase-2.0.4/hbase-webapps/master}

2019-04-03 10:06:19,617 INFO [main] server.AbstractConnector: Started ServerConnector@2c58dcb1{HTTP/1.1,[http/1.1]}{0.0.0.0:16010}

2019-04-03 10:06:19,617 INFO [main] server.Server: Started @4392ms

2019-04-03 10:06:19,621 INFO [main] master.HMaster: hbase.rootdir=hdfs://vhcluster/hbase, hbase.cluster.distributed=true

2019-04-03 10:06:19,644 INFO [Thread-13] master.HMaster: Adding backup master ZNode /hbase/backup-masters/slave1,16000,1554257175910

2019-04-03 10:06:19,664 INFO [master/slave1:16000] regionserver.HRegionServer: ClusterId : ff77d704-a618-4703-a61b-7b70e70cda00

2019-04-03 10:06:19,715 INFO [Thread-13] master.ActiveMasterManager: Another master is the active master, master,16000,1554257116936; waiting to become the next active master

 

[root@slave2 logs]# tail hbase-root-master-slave2.log

2019-04-03 10:10:02,535 INFO [main] server.Server: jetty-9.3.19.v20170502

2019-04-03 10:10:02,572 INFO [main] handler.ContextHandler: Started o.e.j.s.ServletContextHandler@1a891add{/logs,file:///opt/modules/hadoop-3.0.0/hbase-2.0.4/logs/,AVAILABLE}

2019-04-03 10:10:02,572 INFO [main] handler.ContextHandler: Started o.e.j.s.ServletContextHandler@373f7450{/static,file:///opt/modules/hadoop-3.0.0/hbase-2.0.4/hbase-webapps/static/,AVAILABLE}

2019-04-03 10:10:02,663 INFO [main] handler.ContextHandler: Started o.e.j.w.WebAppContext@cbc8d0f{/,file:///opt/modules/hadoop-3.0.0/hbase-2.0.4/hbase-webapps/master/,AVAILABLE}{file:/opt/modules/hadoop-3.0.0/hbase-2.0.4/hbase-webapps/master}

2019-04-03 10:10:02,669 INFO [main] server.AbstractConnector: Started ServerConnector@2c58dcb1{HTTP/1.1,[http/1.1]}{0.0.0.0:16010}

2019-04-03 10:10:02,669 INFO [main] server.Server: Started @3306ms

2019-04-03 10:10:02,672 INFO [main] master.HMaster: hbase.rootdir=hdfs://vhcluster/hbase, hbase.cluster.distributed=true

2019-04-03 10:10:02,694 INFO [Thread-13] master.HMaster: Adding backup master ZNode /hbase/backup-masters/slave2,16000,1554257400094

2019-04-03 10:10:02,722 INFO [master/slave2:16000] regionserver.HRegionServer: ClusterId : ff77d704-a618-4703-a61b-7b70e70cda00

2019-04-03 10:10:02,761 INFO [Thread-13] master.ActiveMasterManager: Another master is the active master, master,16000,1554257116936; waiting to become the next active master

 

查看服务状态

jps

 

[root@master ~]# jps

912 Kafka

20564 QuorumPeerMain

23047 NameNode

23592 DFSZKFailoverController

30712 RunJar

23369 JournalNode

11977 Jps

9549 HMaster

 

[root@slave1 ~]# jps

21698 JournalNode

9858 HRegionServer

10242 HMaster

21605 NameNode

5272 Kafka

10729 Jps

1852 QuorumPeerMain

21949 ResourceManager

21807 DFSZKFailoverController

 

[root@slave2 conf]# jps

31968 QuorumPeerMain

8737 ProdServerStart

19955 HMaster

4852 Kafka

22020 JournalNode

22245 ResourceManager

21926 NameNode

19239 HRegionServer

20554 Jps

22126 DFSZKFailoverController

 

[root@datanode1 ~]# jps

24178 DataNode

24308 NodeManager

8117 Jps

7708 HRegionServer

 

[root@datanode2 ~]# jps

9442 Jps

9043 HRegionServer

22748 DataNode

22876 NodeManager

 

[root@datanode3 ~]# jps

4820 HRegionServer

5208 Jps

25115 DataNode

25245 NodeManager

 

登陆页面查看;

http://10.10.204.31:16010/master-status

Hbase 配置多master节点_第1张图片

你可能感兴趣的:(hadoop)