0

大家好,我在我的主日志中运行 HBase 时遇到了这个异常,而 HMaster 没有运行。

2012-05-20 11:54:38,206 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/23.21.190.123:2181
2012-05-20 11:54:38,236 INFO org.apache.zookeeper.ClientCnxn: Socket connection established to localhost/23.21.190.123:2181, initiating session
2012-05-20 11:54:38,291 INFO org.apache.zookeeper.ClientCnxn: Session establishment complete on server localhost/23.21.190.123:2181, sessionid = 0x1376a1960900000, negotiated timeout = 180000
2012-05-20 11:54:38,323 INFO org.apache.hadoop.metrics.jvm.JvmMetrics: Initializing JVM Metrics with processName=Master, sessionId=ip-10-28-213-145.ec2.internal:60000
2012-05-20 11:54:38,350 INFO org.apache.hadoop.hbase.metrics: MetricsString added: revision
2012-05-20 11:54:38,350 INFO org.apache.hadoop.hbase.metrics: MetricsString added: hdfsUser
2012-05-20 11:54:38,350 INFO org.apache.hadoop.hbase.metrics: MetricsString added: hdfsDate
2012-05-20 11:54:38,350 INFO org.apache.hadoop.hbase.metrics: MetricsString added: hdfsUrl
2012-05-20 11:54:38,350 INFO org.apache.hadoop.hbase.metrics: MetricsString added: date
2012-05-20 11:54:38,350 INFO org.apache.hadoop.hbase.metrics: MetricsString added: hdfsRevision
2012-05-20 11:54:38,350 INFO org.apache.hadoop.hbase.metrics: MetricsString added: user
2012-05-20 11:54:38,350 INFO org.apache.hadoop.hbase.metrics: MetricsString added: hdfsVersion
2012-05-20 11:54:38,350 INFO org.apache.hadoop.hbase.metrics: MetricsString added: url
2012-05-20 11:54:38,350 INFO org.apache.hadoop.hbase.metrics: MetricsString added: version
2012-05-20 11:54:38,350 INFO org.apache.hadoop.hbase.metrics: new MBeanInfo
2012-05-20 11:54:38,351 INFO org.apache.hadoop.hbase.metrics: new MBeanInfo
2012-05-20 11:54:38,351 INFO org.apache.hadoop.hbase.master.metrics.MasterMetrics: Initialized
2012-05-20 11:54:38,452 INFO org.apache.hadoop.hbase.master.ActiveMasterManager: Master=ip-10-28-213-145.ec2.internal:60000
2012-05-20 11:54:40,150 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: localhost/23.21.190.123:54310. Already tried 0 time(s).
2012-05-20 11:54:41,151 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: localhost/23.21.190.123:54310. Already tried 1 time(s).
2012-05-20 11:54:42,153 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: localhost/23.21.190.123:54310. Already tried 2 time(s).
2012-05-20 11:54:43,155 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: localhost/23.21.190.123:54310. Already tried 3 time(s).
2012-05-20 11:54:44,156 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: localhost/23.21.190.123:54310. Already tried 4 time(s).
2012-05-20 11:54:45,157 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: localhost/23.21.190.123:54310. Already tried 5 time(s).
2012-05-20 11:54:46,159 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: localhost/23.21.190.123:54310. Already tried 6 time(s).
2012-05-20 11:54:47,160 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: localhost/23.21.190.123:54310. Already tried 7 time(s).
2012-05-20 11:54:48,161 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: localhost/23.21.190.123:54310. Already tried 8 time(s).
2012-05-20 11:54:49,162 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: localhost/23.21.190.123:54310. Already tried 9 time(s).
2012-05-20 11:54:49,165 FATAL org.apache.hadoop.hbase.master.HMaster: Unhandled exception. Starting shutdown.
java.net.ConnectException: Call to localhost/23.21.190.123:54310 failed on connection exception: java.net.ConnectException: Connection refused
    at org.apache.hadoop.ipc.Client.wrapException(Client.java:767)
    at org.apache.hadoop.ipc.Client.call(Client.java:743)
    at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:220)
    at $Proxy5.getProtocolVersion(Unknown Source)
    at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:359)
    at org.apache.hadoop.hdfs.DFSClient.createRPCNamenode(DFSClient.java:113)
    at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:215)
    at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:177)
    at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:82)
    at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1378)
    at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:66)
    at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1390)
    at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:196)
    at org.apache.hadoop.fs.Path.getFileSystem(Path.java:175)
    at org.apache.hadoop.hbase.util.FSUtils.getRootDir(FSUtils.java:364)
    at org.apache.hadoop.hbase.master.MasterFileSystem.<init>(MasterFileSystem.java:81)
    at org.apache.hadoop.hbase.master.HMaster.finishInitialization(HMaster.java:346)
    at org.apache.hadoop.hbase.master.HMaster.run(HMaster.java:282)
Caused by: java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567)
    at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
    at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:404)
    at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:304)
    at org.apache.hadoop.ipc.Client$Connection.access$1700(Client.java:176)
    at org.apache.hadoop.ipc.Client.getConnection(Client.java:860)
    at org.apache.hadoop.ipc.Client.call(Client.java:720)
    ... 16 more
2012-05-20 11:54:49,168 INFO org.apache.hadoop.hbase.master.HMaster: Aborting
2012-05-20 11:54:49,168 DEBUG org.apache.hadoop.hbase.master.HMaster: Stopping service threads
2012-05-20 11:54:49,168 INFO org.apache.hadoop.ipc.HBaseServer: Stopping server on 60000
2012-05-20 11:54:49,169 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 0 on 60000: exiting
2012-05-20 11:54:49,169 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 1 on 60000: exiting
2012-05-20 11:54:49,169 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 2 on 60000: exiting
2012-05-20 11:54:49,169 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 3 on 60000: exiting
2012-05-20 11:54:49,169 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 4 on 60000: exiting
2012-05-20 11:54:49,170 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 5 on 60000: exiting
2012-05-20 11:54:49,170 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 6 on 60000: exiting
2012-05-20 11:54:49,170 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 7 on 60000: exiting
2012-05-20 11:54:49,170 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 8 on 60000: exiting
2012-05-20 11:54:49,170 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 9 on 60000: exiting
2012-05-20 11:54:49,171 INFO org.apache.hadoop.ipc.HBaseServer: Stopping IPC Server listener on 60000
2012-05-20 11:54:49,194 INFO org.apache.hadoop.ipc.HBaseServer: Stopping IPC Server Responder
2012-05-20 11:54:49,217 INFO org.apache.zookeeper.ClientCnxn: EventThread shut down
2012-05-20 11:54:49,217 INFO org.apache.zookeeper.ZooKeeper: Session: 0x1376a1960900000 closed
2012-05-20 11:54:49,217 INFO org.apache.hadoop.hbase.master.HMaster: HMaster main thread exiting


我搜索了很多但找不到解决方案。这是我的 /etc/hosts 文件

127.0.0.1   localhost hbase-system
23.21.190.123   hbase.com.com hbase localhost


我什至通过评论 localhost 条目(即#127.0.0.1 localhost)来尝试过,但无法运行 HMaster。
这是我的 hbase-site.xml

<configuration>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.rootdir</name>
<value>hdfs://localhost:54310/hbase</value>
</property>

这是我的 hadoop core-site.xml

<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>/app/hadoop/tmp</value>
</property><property>
<name>fs.default.name</name>
<value>hdfs://localhost:54310</value>
</property>
</configuration>

如果有人遇到问题请帮助我
谢谢

4

3 回答 3

1
  1. 将 hadoop 核心文件从 hadoop home 添加到 hbase lib 文件夹
  2. 检查集群中 hbase 的版本。如果有差异,可能会出错。
  3. 使用 IP 地址而不是 localhost
  4. 检查 ssh 连接。
于 2012-06-07T08:41:08.383 回答
0

如果您在伪模式下运行 Hbase,则不需要 IP..Loopback 工作正常..所以只需将这两行设为“127.0.0.1”...还在您的 hbse-site.xml 文件中添加以下 2 个属性 -

<property>
  <name>hbase.zookeeper.quorum</name>
  <value>localhost</value>
</property>    
<property>
      <name>hbase.zookeeper.property.clientPort</name>
      <value>2181</value>         
</property>

除此之外,将以下 jars 添加到您的“HBASE_HOME/lib”目录中 - HADOOP_HOME 中的“hadoop-core-*-.jar”和 HADOOP_HOME/lib 目录中的“commons-collections-3.2.1.jar”。

于 2012-05-22T09:14:36.883 回答
0

不确定这是罪魁祸首,但我确实看到您的 /etc/hosts 存在问题:
您将 localhost 定义为 2 个不同的地址。

可能你想要

127.0.0.1   hbase localhost hbase-system
23.21.190.123   hbase.com.com

HTH、
GL

于 2014-05-16T18:32:10.723 回答