hbase无法连接到zookeeper?

时间:2015-09-12 10:52:04

标签: hbase apache-zookeeper connectexception

我使用start-hbase.sh运行hbase,但日志文件输出异常如下:

2015-09-12 18:39:37,935 WARN  [RS:0;roger-ubuntu:54809-SendThread(localhost:2181)] zookeeper.ClientCnxn: Session 0x14fc12354a40004 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: 拒绝连接
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:740)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)

根据Exception,hbase无法连接到zookeeper,但是这个hbase应该为自己运行一个zookeeper。

这是我的hbase-site.xml

<configuration>
    <property>
        <name>hbase.coprocessor.region.classes</name>
        <value>com.gzhdi.coprocessor.HelloWorldEndPoint</value>
    </property>
</configuration>

和我的hbase-env.sh

export HBASE_OPTS="-XX:+UseConcMarkSweepGC"

1 个答案:

答案 0 :(得分:1)

您是否必须在hbase-site.xml中设置hbase.zookeeper.quorum属性?同时检查classpath是否设置正确,请查看此文档:Package org.apache.hadoop.hbase.mapreduce

你在运行一个独立的HBase吗?您始终可以看到运行hbase zkcli进行检查。