我正在伪分布式模式下运行一个hdfs实例,并尝试在同一台服务器上建立另一个连接到它的hbase实例。hadoop中的日志没有问题,但我经常在hbase的日志中看到连接失败
==================================================================================
2012-05-01 10:49:07,212 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
2012-05-01 10:49:07,213 WARN org.apache.zookeeper.ClientCnxn: Session 0x13708dc552d0001 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:567)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
2012-05-01 10:49:08,882 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
2012-05-01 10:49:08,882 WARN org.apache.zookeeper.ClientCnxn: Session 0x13708dc552d0001 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:567)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)==================================================================================
配置core-site.xml@hadoop
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>配置hbase-site.xml@hbase
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://localhost:9000/hbase</value>
</property>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>我还尝试将localhost替换为服务器的实际ip,但得到了相同的错误。
发布于 2012-05-01 23:33:05
我认为Hbase找不到zookeeper仲裁,您必须在hbase-site.xml中设置hbase.zookeeper.quorum属性。还要检查类路径是否设置正确,请签出此文档的http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/mapreduce/package-summary.html#classpath
发布于 2012-05-02 05:01:35
jps进行检查。如果它没有运行,您可以通过start-hbase.sh命令或hbase master start运行它。然后通过其他命令检查它的状态,比如netstat -an | grep 9000
sudo iptables -L检查iptables配置。您可以在基于redhat的linux系统下通过sudo service iptables stop命令禁用iptables。使用getenforce检查SElinux是否处于enforcing模式。
ssh等发布于 2012-05-07 00:48:27
您需要用$ hadoop _HOME/ hadoop -{{core.jar}}版本中的那个来替换hadoop中的核心hadoop jar。当我尝试从hbase 0.90-xxx安装hbase 0.92时,我遇到了同样的问题,我将hbase-env.sh和hbase-site.xml从旧的hbase替换为新的,但忘记复制hadoop核心jar。
https://stackoverflow.com/questions/10399552
复制相似问题