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


[hadoop@Master bin]$ ./start-hbase.sh 
starting master, logging to /usr/hadoop/hbase/logs/hbase-hadoop-master-Master.Hadoop.out
192.168.1.4: starting regionserver, logging to /usr/hadoop/hbase/logs/hbase-hadoop-regionserver-Slave2.Hadoop.out
192.168.1.5: regionserver running as process 7155. Stop it first.
192.168.1.3: starting regionserver, logging to /usr/hadoop/hbase/logs/hbase-hadoop-regionserver-Slave1.Hadoop.out
192.168.1.4: Exception in thread "main" java.lang.RuntimeException: Failed construction of Regionserver: class org.apache.hadoop.hbase.regionserver.HRegionServer
192.168.1.4: 	at org.apache.hadoop.hbase.regionserver.HRegionServer.constructRegionServer(HRegionServer.java:3977)
192.168.1.4: 	at org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.start(HRegionServerCommandLine.java:60)
192.168.1.4: 	at org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.run(HRegionServerCommandLine.java:75)
192.168.1.4: 	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
192.168.1.4: 	at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:76)
192.168.1.4: 	at org.apache.hadoop.hbase.regionserver.HRegionServer.main(HRegionServer.java:4001)
192.168.1.4: Caused by: java.lang.reflect.InvocationTargetException
192.168.1.4: 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
192.168.1.4: 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
192.168.1.3: Exception in thread "main" java.lang.RuntimeException: Failed construction of Regionserver: class org.apache.hadoop.hbase.regionserver.HRegionServer
192.168.1.3: 	at org.apache.hadoop.hbase.regionserver.HRegionServer.constructRegionServer(HRegionServer.java:3977)
192.168.1.3: 	at org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.start(HRegionServerCommandLine.java:60)
192.168.1.3: 	at org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.run(HRegionServerCommandLine.java:75)
192.168.1.3: 	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
192.168.1.3: 	at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:76)
192.168.1.3: 	at org.apache.hadoop.hbase.regionserver.HRegionServer.main(HRegionServer.java:4001)
192.168.1.3: Caused by: java.lang.reflect.InvocationTargetException
192.168.1.3: 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
192.168.1.3: 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
[hadoop@Master bin]$ netstat -apn | grep 60020
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
[hadoop@Master bin]$

查看日志信息:

2013-05-14 17:36:17,367 INFO org.apache.hadoop.hbase.util.VersionInfo: HBase 0.94.7
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
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
2013-05-14 17:36:17,504 DEBUG org.apache.hadoop.hbase.master.HMaster: Set serverside HConnection retries=100
2013-05-14 17:36:17,689 ERROR org.apache.hadoop.hbase.master.HMasterCommandLine: Failed to start master
java.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMaster
        at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:2030)
        at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:152)
        at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:104)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
        at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:76)
        at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:2044)
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:344)
        at sun.nio.ch.Net.bind(Net.java:336)
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
        at org.apache.hadoop.hbase.ipc.HBaseServer.bind(HBaseServer.java:256)
        at org.apache.hadoop.hbase.ipc.HBaseServer$Listener.<init>(HBaseServer.java:482)
        at org.apache.hadoop.hbase.ipc.HBaseServer.<init>(HBaseServer.java:1559)
        at org.apache.hadoop.hbase.ipc.WritableRpcEngine$Server.<init>(WritableRpcEngine.java:252)
        at org.apache.hadoop.hbase.ipc.WritableRpcEngine.getServer(WritableRpcEngine.java:201)
        at org.apache.hadoop.hbase.ipc.WritableRpcEngine.getServer(WritableRpcEngine.java:55)
        at org.apache.hadoop.hbase.ipc.HBaseRPC.getServer(HBaseRPC.java:330)
        at org.apache.hadoop.hbase.ipc.HBaseRPC.getServer(HBaseRPC.java:319)
        at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:302)
        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:525)
        at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:2025)
        ... 5 more
查看发现是端口被占用,查找占用6000/60020的进程并杀死:
[hadoop@Master logs]$ netstat -apn | grep 60000
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 ::ffff:192.168.1.2:60000    :::*                        LISTEN      17681/java          
[hadoop@Master logs]$ kill 17681
重启仍出现这样的问题,没办法了~~~


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


1、启动Hbase之前尽量关闭Hadoop的HDFS的安全模式,未关闭可能会造成Hbase在HDFS上创建文件不成功,日志记录中也会出现如下记录:
2012-04-10 21:37:01,999 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2012-04-10 21:37:12,003 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2012-04-10 21:37:22,006 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2012-04-10 21:37:32,011 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...

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



你可能感兴趣的:(Hbase无法启动,报:Address already in use)