hbase 的back masters不能启动问题

版本:apache的hbase-1.0.1.1版本

完全分布式配置如下:
QQ截图20150817170331.jpg



data-1是master,剩下的三个是RegionServer,运行一切正常

现在想把data-2变成back master节点,在conf文件下新建backup-masters文件,添加data-2这一行,

然后把backup-masters复制到所有的节点上,

在data-1上启动hbase

[hadoop@data-1 bin]$ ./start-hbase.sh
starting master, logging to /usr/local/hbase-1.0.1.1/logs/hbase-hadoop-master-data-1.out
data-3: starting regionserver, logging to /usr/local/hbase-1.0.1.1/bin/../logs/hbase-hadoop-regionserver-data-3.out
data-4: starting regionserver, logging to /usr/local/hbase-1.0.1.1/bin/../logs/hbase-hadoop-regionserver-data-4.out
data-2: starting regionserver, logging to /usr/local/hbase-1.0.1.1/bin/../logs/hbase-hadoop-regionserver-data-2.out
data-2: starting master, logging to /usr/local/hbase-1.0.1.1/bin/../logs/hbase-hadoop-master-data-2.out

看起来一切正常,但是在data-2上备份节点没有启动起来,在data-2上查看hbase-hadoop-master-data-2.log日志

错误如下:

2015-06-28 23:56:18,156 INFO  [main] util.ServerCommandLine: env:HBASE_THRIFT_OPTS=
2015-06-28 23:56:18,157 INFO  [main] util.ServerCommandLine: env:PATH=/usr/local/bin:/bin:/usr/bin
2015-06-28 23:56:18,157 INFO  [main] util.ServerCommandLine: env:USER=hadoop
2015-06-28 23:56:18,157 INFO  [main] util.ServerCommandLine: env:HBASE_SECURITY_LOGGER=INFO,RFAS
2015-06-28 23:56:18,158 INFO  [main] util.ServerCommandLine: env:HOME=/home/hadoop
2015-06-28 23:56:18,158 INFO  [main] util.ServerCommandLine: env:LESSOPEN=|/usr/bin/lesspipe.sh %s
2015-06-28 23:56:18,165 INFO  [main] util.ServerCommandLine: env:HBASE_START_FILE=/tmp/hbase-hadoop-master.autorestart
2015-06-28 23:56:18,165 INFO  [main] util.ServerCommandLine: env:HBASE_LOGFILE=hbase-hadoop-master-data-2.log
2015-06-28 23:56:18,165 INFO  [main] util.ServerCommandLine: env:LANG=en_US.UTF-8
2015-06-28 23:56:18,165 INFO  [main] util.ServerCommandLine: env:HBASE_LOG_PREFIX=hbase-hadoop-master-data-2
2015-06-28 23:56:18,165 INFO  [main] util.ServerCommandLine: env:HBASE_IDENT_STRING=hadoop
2015-06-28 23:56:18,167 INFO  [main] util.ServerCommandLine: vmName=Java HotSpot(TM) 64-Bit Server VM, vmVendor=Oracle Corporation, vmVersion=24.79-b02
2015-06-28 23:56:18,167 INFO  [main] util.ServerCommandLine: vmInputArguments=[-Dproc_master, -XX:OnOutOfMemoryError=kill -9 %p, -XX:+UseConcMarkSweepGC, -Dhbase.log.dir=/usr/local/hbase-1.0.1.1/bin/../logs, -Dhbase.log.file=hbase-hadoop-master-data-2.log, -Dhbase.home.dir=/usr/local/hbase-1.0.1.1/bin/.., -Dhbase.id.str=hadoop, -Dhbase.root.logger=INFO,RFA, -Dhbase.security.logger=INFO,RFAS]
2015-06-28 23:56:19,798 INFO  [main] regionserver.RSRpcServices: master/data-2/10.116.107.94:16020 server-side HConnection retries=350
2015-06-28 23:56:20,504 INFO  [main] ipc.SimpleRpcScheduler: Using deadline as user call queue, count=3
2015-06-28 23:56:20,543 ERROR [main] master.HMasterCommandLine: Master exiting
java.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMaster
        at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:1988)
        at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:203)
        at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:139)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
        at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:126)
        at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:2002)
Caused by: java.net.BindException: Address already in use
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Net.java:444)
        at sun.nio.ch.Net.bind(Net.java:436)
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
        at org.apache.hadoop.hbase.ipc.RpcServer.bind(RpcServer.java:2369)
        at org.apache.hadoop.hbase.ipc.RpcServer$Listener.<init>(RpcServer.java:524)
        at org.apache.hadoop.hbase.ipc.RpcServer.<init>(RpcServer.java:1899)
        at org.apache.hadoop.hbase.regionserver.RSRpcServices.<init>(RSRpcServices.java:792)
        at org.apache.hadoop.hbase.master.MasterRpcServices.<init>(MasterRpcServices.java:195)
        at org.apache.hadoop.hbase.master.HMaster.createRpcServices(HMaster.java:477)
        at org.apache.hadoop.hbase.regionserver.HRegionServer.<init>(HRegionServer.java:492)
        at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:333)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:1983)
        ... 5 more

提示Master exiting,地址已经使用了,不知如何修改,才能配置一个back master

zp0824 - 好好学习,天天向上

赞同来自:

netstat看一下data-2上的端口被什么进程占用着。

夕阳丶一抹红颜 - 一句话介绍

赞同来自:

不太明白是哪个端口被占了

夕阳丶一抹红颜 - 一句话介绍

赞同来自:

data-1节点网络端口
233407fb468d799556.png
233433935c7f581786.png
 

zp0824 - 好好学习,天天向上

赞同来自:

那就在这个data-2上ps ax | fgrep 12373看看这个进程是什么?

夕阳丶一抹红颜 - 一句话介绍

赞同来自:

看过,是RegionServer的进程

zp0824 - 好好学习,天天向上

赞同来自:

你在这个data-2上用什么命令启动的master?

夕阳丶一抹红颜 - 一句话介绍

赞同来自:

不好意思,久等了,可以关闭了

zp0824 - 好好学习,天天向上

赞同来自:

data-1跟data-2上都有regionserver,他们有相同端口没什么奇怪,你能看看data-1上的master监听了什么端口么?然后再确定data-2上是不是这个端口被占了?

夕阳丶一抹红颜 - 一句话介绍

赞同来自:

非常抱歉,最近一直在加班,所以没有时间研究 这个问题,研究了下,是因为: 新版本中16020端口,会同时被master和regionserver服务占用,导致端口冲突,所以不能正常启动, 解决方案如下: a、在data-1节点上,${HBASE_HOME}/conf目录下,删除regionservers文件中的data-2节点,先不启regionserver b、backup-masters中放入 data-2 信息,优先启动master服务 c、在data-1中,执行 bin/start-hbase.sh 后,在data-2节点上执行bin/local-regionservers.sh start 1(2,3,4...) 启动regionserver 主要思想就是先启动master,再启动regionservers,regionservers使用不同的端口号启动 这样data-2上master和regionserver同时运行了,截图如下:
220814e51b66037720.png
 

要回复问题请先登录注册