2012-04-17 5 views
13

안녕하세요, HBase하둡입니다. HBase를 완전히 설정하고 완벽하게 시작했습니다. 이제 p1에서 HBase (HBase 설정은 , p2)에 연결하려고하면 Java 클라이언트를 사용하여 이상한 예외가 발생합니다.hbase connection refused

12/04/17 14:36:37 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=192.168.15.20:2181 sessionTimeout=180000 watcher=hconnection 
12/04/17 14:36:38 INFO zookeeper.ClientCnxn: Opening socket connection to server /192.168.15.20:2181 
12/04/17 14:36:38 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:567) 
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119) 
12/04/17 14:36:39 INFO zookeeper.ClientCnxn: Opening socket connection to server hbase.local/192.168.15.20:2181 
12/04/17 14:36:39 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:567) 
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119) 
12/04/17 14:36:41 INFO zookeeper.ClientCnxn: Opening socket connection to server hbase.local/192.168.15.20:2181 
12/04/17 14:36:41 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:567) 
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119) 
12/04/17 14:36:43 INFO zookeeper.ClientCnxn: Opening socket connection to server hbase.local/192.168.15.20:2181 
12/04/17 14:36:43 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:567) 
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119) 
12/04/17 14:36:44 INFO zookeeper.ClientCnxn: Opening socket connection to server hbase.local/192.168.15.20:2181 
12/04/17 14:36:44 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:567) 
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119) 
12/04/17 14:36:45 INFO zookeeper.ClientCnxn: Opening socket connection to server hbase.local/192.168.15.20:2181 
12/04/17 14:36:45 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:567) 
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119) 
12/04/17 14:36:47 INFO zookeeper.ClientCnxn: Opening socket connection to server hbase.local/192.168.15.20:2181 
12/04/17 14:36:47 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:567) 
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119) 
12/04/17 14:36:48 INFO zookeeper.ClientCnxn: Opening socket connection to server hbase.local/192.168.15.20:2181 
12/04/17 14:36:48 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:567) 
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119) 
12/04/17 14:36:49 INFO zookeeper.ClientCnxn: Opening socket connection to server hbase.local/192.168.15.20:2181 
12/04/17 14:36:49 INFO zookeeper.ZooKeeper: Session: 0x0 closed 
org.apache.hadoop.hbase.ZooKeeperConnectionException: HBase is able to connect to ZooKeeper but the connection closes immediately. This could be a sign that the server has too many connections (30 is the default). Consider inspecting your ZK server logs for that error and then make sure you are reusing HBaseConfiguration as often as you can. See HTable's javadoc for more information. 
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:155) 
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getZooKeeperWatcher(HConnectionManager.java:1002) 
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.setupZookeeperTrackers(HConnectionManager.java:304) 
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.<init>(HConnectionManager.java:295) 
    at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:157) 
    at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:90) 
    at org.apache.hadoop.hbase.client.HBaseAdmin.checkHBaseAvailable(HBaseAdmin.java:1258) 
    at HBaseDemo.main(HBaseDemo.java:55) 
Caused by: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase 
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:90) 
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:42) 
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:809) 
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:837) 
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.createAndFailSilent(ZKUtil.java:903) 
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:133) 
    ... 7 more 
12/04/17 14:36:49 INFO zookeeper.ClientCnxn: EventThread shut down 
Execution script exiting 

/04/17 17:41:35 INFO zookeeper.ZooKeeper: Client environment:user.name=xyz 
12/04/17 17:41:35 INFO zookeeper.ZooKeeper: Client environment:user.home=/home/xyz 
12/04/17 17:41:35 INFO zookeeper.ZooKeeper: Client environment:user.dir=/opt/xyz/hbase-sample 
12/04/17 17:41:35 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=192.168.15.169:2181 sessionTimeout=180000 watcher=hconnection 
12/04/17 17:41:35 INFO zookeeper.ClientCnxn: Opening socket connection to server /192.168.15.169:2181 
12/04/17 17:41:35 INFO zookeeper.ClientCnxn: Socket connection established to hbase.xyz.com/192.168.15.169:2181, initiating session 
12/04/17 17:41:35 INFO zookeeper.ClientCnxn: Session establishment complete on server hbase.xyz.com/192.168.15.169:2181, sessionid = 0x136c00d59ac0009, negotiated timeout = 180000 
12/04/17 17:41:36 INFO client.HConnectionManager$HConnectionImplementation: getMaster attempt 0 of 1 failed; no more retrying. 
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:604) 
at org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupIOstreams(HBaseClient.java:328) 
at org.apache.hadoop.hbase.ipc.HBaseClient.getConnection(HBaseClient.java:883) 
at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:750) 
at org.apache.hadoop.hbase.ipc.HBaseRPC$Invoker.invoke(HBaseRPC.java:257) 
at $Proxy4.getProtocolVersion(Unknown Source) 
at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:419) 
at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:393) 
at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:444) 
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:360) 
at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:94) 
at org.apache.hadoop.hbase.client.HBaseAdmin.checkHBaseAvailable(HBaseAdmin.java:1258) 
at HBaseDemo.main(HBaseDemo.java:55) 
HBase is not running! 
Execution script exiting 
+2

나는 일반적으로 적은 정보보다는 더 많은 정보를 원하지만,이 오류 문을 약간 적게 인쇄했는지 궁금합니다. 그것은 많은 것을 반복하고 다른 어떤 것보다 WALLOFTEXT처럼 더 많이 보입니다. 아마 그것은 중요하지 않습니다. – theJollySin

+0

답장을 보내 주셔서 감사합니다. 지금 전체 출력을 게시 해주세요. – khan

답변

5

나는 해결책을 발견했다.

로컬 호스트 항목을 내 /etc/hosts에서 삭제하면됩니다. 이제 내 localhost 항목은 로컬 호스트가 127.0.0.1 대신 192.169.19.50 [내 hbase IP] = localhost와 같습니다.

+0

khan - 의사 모드에서 hbase, hadoop, nutch를 같은 서버에서 실행할 때이 오류가 발생합니다./etc/hosts 파일을 편집해야합니까? – sunskin

+4

조금 의심스러운 해결책. 클라이언트 또는 서버 측에서 hbase.zookeeper.quorum 속성을 더 잘 수정해야합니다. – user1455836

+0

@ user1455836 님의 제안에 따라 DNS 캐시를 비우고 다시 시작하면 (순수한 미신?) 나를 위해 일했습니다. 내 Mac의 경우,'hbase.zookeeper.quorum' 항목을'/ usr/local/Cellar/hbase/1.0.1/libexec/conf/hbase-site.xml'에 ' .local'의 값으로 추가했습니다. . 사육사는 이제 모든 축복, 영광 및 사용자 친숙 함으로 다시 살아납니다. –

4

허용 된 대답은 효과가 있지만 부작용 일 수 있습니다.

문제는 HBase가 외부 마주 보는 인터페이스가 아닌 로컬 호스트에서 수신하는 포트 (즉, 루프백)를 여는 것입니다./etc/hosts에서 localhost 항목을 제거하면 HBase가 외부 인터페이스에 바인드됩니다. 단, localhost를 찾을 수 없기 때문입니다. 일부 데몬이 합법적으로 localhost (lo를 통해)를 수신하거나 연결할 때 문제가 될 수 있습니다.

텔넷을 사용하여 localhost 또는 컴퓨터에 할당 된 IP를 통해 포트 60000에 연결하여이 문제가 발생하는지 테스트 할 수 있습니다. 로컬 호스트 (HBase가 연결되어 있기 때문에)가 아닌 IP를 통해 연결할 수 있습니다.

HBase conf에서 컴퓨터 이름을 사용하는 것이 좋습니다.

+0

호스트 이름 또는 IP, 예제 HBase를-site.xml의 재산 "hbase.master"을 설정하는 클러스터 구성 할 때'코드 hbase.master 192.168.1.111:16000 를' – lourencoccc

3

HBase에 대한 구성을 인스턴스화했다고 가정하면 hbase master, zookeeper quorum 및 znode parent를 설정하십시오. 이 같은 -

import org.apache.hadoop.hbase.HBaseConfiguration; 

public class CLASS_NAME{ 
    Configuration configuration = new HBaseConfiguration.Create(); 
    configuration.set(hbase master, ""); 
    configuration.set(zookeeper quorum, ""); 
    configuration.set(znode parent, ""); 
} 
관련 문제