【问题描述】
搭建单机集群(hadoop-2.2.0),遇到下述错误:
2014-05-29 12:32:42,922 WARN org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper: Node /hbase/backup-masters/node1,60000,1401337962079 already deleted, and this is not a retry
2014-05-29 12:32:42,922 INFO org.apache.hadoop.hbase.master.ActiveMasterManager: Master=node1,60000,1401337962079
2014-05-29 12:32:44,090 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: node1/10.40.0.201:9000. Already tried 0 time(s).
2014-05-29 12:32:45,091 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: node1/10.40.0.201:9000. Already tried 1 time(s).
2014-05-29 12:32:46,092 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: node1/10.40.0.201:9000. Already tried 2 time(s).
2014-05-29 12:32:47,093 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: node1/10.40.0.201:9000. Already tried 3 time(s).
2014-05-29 12:32:48,093 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: node1/10.40.0.201:9000. Already tried 4 time(s).
2014-05-29 12:32:49,094 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: node1/10.40.0.201:9000. Already tried 5 time(s).
2014-05-29 12:32:50,095 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: node1/10.40.0.201:9000. Already tried 6 time(s).
2014-05-29 12:32:51,096 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: node1/10.40.0.201:9000. Already tried 7 time(s).
2014-05-29 12:32:52,096 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: node1/10.40.0.201:9000. Already tried 8 time(s).
2014-05-29 12:32:53,097 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: node1/10.40.0.201:9000. Already tried 9 time(s).
2014-05-29 12:32:53,100 FATAL org.apache.hadoop.hbase.master.HMaster: Unhandled exception. Starting shutdown.
java.net.ConnectException: Call to node1/10.40.0.201:9000 failed on connection exception: java.net.ConnectException: Connection refused
at org.apache.hadoop.ipc.Client.wrapException(Client.java:1099)
at org.apache.hadoop.ipc.Client.call(Client.java:1075)
at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:225)
at com.sun.proxy.$Proxy10.getProtocolVersion(Unknown Source)
at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:396)
at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:379)
at org.apache.hadoop.hdfs.DFSClient.createRPCNamenode(DFSClient.java:119)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:238)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:203)
at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:89)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1386)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:66)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1404)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:254)
at org.apache.hadoop.fs.Path.getFileSystem(Path.java:187)
at org.apache.hadoop.hbase.util.FSUtils.getRootDir(FSUtils.java:666)
at org.apache.hadoop.hbase.master.MasterFileSystem.<init>(MasterFileSystem.java:112)
at org.apache.hadoop.hbase.master.HMaster.finishInitialization(HMaster.java:573)
at org.apache.hadoop.hbase.master.HMaster.run(HMaster.java:432)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:599)
at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:489)
at org.apache.hadoop.ipc.Client$Connection.setupConnection(Client.java:434)
at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:560)
at org.apache.hadoop.ipc.Client$Connection.access$2000(Client.java:184)
at org.apache.hadoop.ipc.Client.getConnection(Client.java:1206)
at org.apache.hadoop.ipc.Client.call(Client.java:1050)
... 18 more
2014-05-29 12:32:53,104 INFO org.apache.hadoop.hbase.master.HMaster: Aborting
2014-05-29 12:32:53,104 DEBUG org.apache.hadoop.hbase.master.HMaster: Stopping service threads
【解决办法】
单机HBase不支持HDFS,需要修改hbase-site.xml中的hbase.rootdir参数为本地路径,例如:
<property>
<name>hbase.rootdir</name>
<value>file:///mnt/sdb1/hbase</value>
</property>