例外:org.apache.hadoop.hbase.masternotrunningexception

时间:2014-02-19 16:50:33

标签: java hadoop hbase

我正在使用java运行hbase,我的hbase很早就开始了,现在当我在

中给出“list”命令时

hbase(main):001:0:>> list

它键入“TABLE”并在终端上提供如此多的java行并以

结束

错误:org.apache.hadoop.hbase.masternotrunningexception:重试7次

我停止了hbase并重新启动,但它对我不起作用。

这是日志的痕迹:

14/02/18 07:16:17 INFO zookeeper.ZooKeeper: Initiating client
connection, connectString=localhost:2181 sessionTimeout=180000
watcher=hconnection
14/02/18 07:16:17 INFO zookeeper.ClientCnxn: Opening socket connection
to server localhost/127.0.0.1:2181. Will not attempt to authenticate
using SASL (unknown error)
14/02/18 07:16:17 INFO zookeeper.RecoverableZooKeeper: The identifier
of this process is 5461@ubuntu
14/02/18 07:16:17 WARN zookeeper.ClientCnxn: Session 0x0 for server
null, unexpected error, closing socket connection and attempting
reconnect
java.net.ConnectException: Connection refused
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:597)
        at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
14/02/18 07:16:17 WARN zookeeper.RecoverableZooKeeper: Possibly
transient ZooKeeper exception:
org.apache.zookeeper.KeeperException$ConnectionLossException:
KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
14/02/18 07:16:17 INFO util.RetryCounter: Sleeping 2000ms before retry #1...
14/02/18 07:16:18 INFO zookeeper.ClientCnxn: Opening socket connection
to server localhost/127.0.0.1:2181. Will not attempt to authenticate
using SASL (unknown error)
14/02/18 07:16:18 WARN zookeeper.ClientCnxn: Session 0x0 for server
null, unexpected error, closing socket connection and attempting
reconnect
java.net.ConnectException: Connection refused
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:597)
        at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
14/02/18 07:16:19 INFO zookeeper.ClientCnxn: Opening socket connection
to server localhost/127.0.0.1:2181. Will not attempt to authenticate
using SASL (unknown error)
14/02/18 07:16:19 WARN zookeeper.ClientCnxn: Session 0x0 for server
null, unexpected error, closing socket connection and attempting
reconnect
java.net.ConnectException: Connection refused
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:597)
        at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
14/02/18 07:16:19 WARN zookeeper.RecoverableZooKeeper: Possibly
transient ZooKeeper exception:
org.apache.zookeeper.KeeperException$ConnectionLossException:
KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
14/02/18 07:16:19 INFO util.RetryCounter: Sleeping 4000ms before retry #2``

我的hbase-site.xml:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Apache 2 License ommitted to keep the output short  -->
<configuration>
    <property>
       <name>hbase.rootdir</name>
       <value>file:///home/hduser/HBASE/hbase</value>
    </property>
    <property>
       <name>hbase.zookeeper.property.dataDir</name>
        <value>/home/hduser/HBASE/zookeeper</value>
   </property>
   <property>
      <name>hbase.zookeeper.property.clientPort</name>
      <value>2222</value>
      <description>Property from ZooKeeper's config zoo.cfg.
      The port at which the clients will connect.
      </description>
    </property>
    <property>
      <name>hbase.zookeeper.quorum</name>
      <value>localhost</value>
    </property>
 </configuration>

1 个答案:

答案 0 :(得分:0)

请确保您的zookeeper运行正常,并且您没有任何与名称解析相关的问题。另外,请确保在 hbase-site.xml 中添加了 hbase.zookeeper.quorum 属性。如果问题仍然存在,请向我们展示您的hbase-site.xml文件。