欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

Hbase无法启动,报:Address already in use

程序员文章站 2022-06-12 15:03:46
...

Hbase无法启动,报:Address already in use 01 [hadoop@Master bin]$ ./start-hbase.sh 02 starting master, logging to /usr/hadoop/hbase/logs/hbase-hadoop-master-Master.Hadoop.out 03 192.168.1.4: starting regionserver, logging to /usr/hadoop/hb

Hbase无法启动,报:Address already in use

01

[hadoop@Master bin]$ ./start-hbase.sh

02

starting master, logging to /usr/hadoop/hbase/logs/hbase-hadoop-master-Master.Hadoop.out

03

192.168.1.4: starting regionserver, logging to /usr/hadoop/hbase/logs/hbase-hadoop-regionserver-Slave2.Hadoop.out

04

192.168.1.5: regionserver running as process 7155. Stop it first.

05

192.168.1.3: starting regionserver, logging to /usr/hadoop/hbase/logs/hbase-hadoop-regionserver-Slave1.Hadoop.out

06

192.168.1.4: Exception in thread "main" java.lang.RuntimeException: Failed construction of Regionserver: class org.apache.hadoop.hbase.regionserver.HRegionServer

07

192.168.1.4: at org.apache.hadoop.hbase.regionserver.HRegionServer.constructRegionServer(HRegionServer.java:3977)

08

192.168.1.4: at org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.start(HRegionServerCommandLine.java:60)

09

192.168.1.4: at org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.run(HRegionServerCommandLine.java:75)

10

192.168.1.4: at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)

11

192.168.1.4: at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:76)

12

192.168.1.4: at org.apache.hadoop.hbase.regionserver.HRegionServer.main(HRegionServer.java:4001)

13

192.168.1.4: Caused by: java.lang.reflect.InvocationTargetException

14

192.168.1.4: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

15

192.168.1.4: at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

16

192.168.1.3: Exception in thread "main" java.lang.RuntimeException: Failed construction of Regionserver: class org.apache.hadoop.hbase.regionserver.HRegionServer

17

192.168.1.3: at org.apache.hadoop.hbase.regionserver.HRegionServer.constructRegionServer(HRegionServer.java:3977)

18

192.168.1.3: at org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.start(HRegionServerCommandLine.java:60)

19

192.168.1.3: at org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.run(HRegionServerCommandLine.java:75)

20

192.168.1.3: at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)

21

192.168.1.3: at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:76)

22

192.168.1.3: at org.apache.hadoop.hbase.regionserver.HRegionServer.main(HRegionServer.java:4001)

23

192.168.1.3: Caused by: java.lang.reflect.InvocationTargetException

24

192.168.1.3: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

25

192.168.1.3: at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

26

[hadoop@Master bin]$ netstat -apn | grep 60020

27

(Not all processes could be identified, non-owned process info

28

will not be shown, you would have to be root to see it all.)

29

[hadoop@Master bin]$

查看日志信息:

01

2013-05-14 17:36:17,367 INFO org.apache.hadoop.hbase.util.VersionInfo: HBase 0.94.7

02

2013-05-14 17:36:17,368 INFO org.apache.hadoop.hbase.util.VersionInfo: Subversion https://svn.apache.org/repos/asf/hbase/tags/0.94.7RC1 -r 1471806

03

2013-05-14 17:36:17,368 INFO org.apache.hadoop.hbase.util.VersionInfo: Compiled by lhofhans on Wed Apr 24 18:48:26 PDT 2013

04

2013-05-14 17:36:17,504 DEBUG org.apache.hadoop.hbase.master.HMaster: Set serverside HConnection retries=100

05

2013-05-14 17:36:17,689 ERROR org.apache.hadoop.hbase.master.HMasterCommandLine: Failed to start master

06

java.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMaster

07

at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:2030)

08

at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:152)

09

at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:104)

10

at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)

11

at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:76)

12

at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:2044)

13

Caused by: java.net.BindException: Address already in use

14

at sun.nio.ch.Net.bind0(Native Method)

15

at sun.nio.ch.Net.bind(Net.java:344)

16

at sun.nio.ch.Net.bind(Net.java:336)

17

at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199)

18

at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)

19

at org.apache.hadoop.hbase.ipc.HBaseServer.bind(HBaseServer.java:256)

20

at org.apache.hadoop.hbase.ipc.HBaseServer$Listener.(HBaseServer.java:482)

21

at org.apache.hadoop.hbase.ipc.HBaseServer.(HBaseServer.java:1559)

22

at org.apache.hadoop.hbase.ipc.WritableRpcEngine$Server.(WritableRpcEngine.java:252)

23

at org.apache.hadoop.hbase.ipc.WritableRpcEngine.getServer(WritableRpcEngine.java:201)

24

at org.apache.hadoop.hbase.ipc.WritableRpcEngine.getServer(WritableRpcEngine.java:55)

25

at org.apache.hadoop.hbase.ipc.HBaseRPC.getServer(HBaseRPC.java:330)

26

at org.apache.hadoop.hbase.ipc.HBaseRPC.getServer(HBaseRPC.java:319)

27

at org.apache.hadoop.hbase.master.HMaster.(HMaster.java:302)

28

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

29

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

30

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

31

at java.lang.reflect.Constructor.newInstance(Constructor.java:525)

32

at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:2025)

33

... 5 more

查看发现是端口被占用,查找占用6000/60020的进程并杀死:

1

[hadoop@Master logs]$ netstat -apn | grep 60000

2

(Not all processes could be identified, non-owned process info

3

will not be shown, you would have to be root to see it all.)

4

tcp 0 0 ::ffff:192.168.1.2:60000 :::* LISTEN 17681/java

5

[hadoop@Master logs]$ kill 17681

重启仍出现这样的问题,没办法了~~~

今天再重新启动后,查看日志:

1

1、启动Hbase之前尽量关闭Hadoop的HDFS的安全模式,未关闭可能会造成Hbase在HDFS上创建文件不成功,日志记录中也会出现如下记录:

2

2012-04-10 21:37:01,999 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...

3

2012-04-10 21:37:12,003 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...

4

2012-04-10 21:37:22,006 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...

5

2012-04-10 21:37:32,011 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...

6

7

解决方法:使用 hadoop dfsadmin -safemode leave 命令使Hadoop退出安全模式