lzj01231 2023-03-31 00:07 采纳率: 70.6%
浏览 35
已结题

关于Eclipse远程连接伪分布式HBase的问题,如何解决?

使用Eclipse远程连接伪分布式Hadoop,使用java代码对Hbase进行操作

报错以下代码

2023-03-30 23:51:25,201 INFO  [ReadOnlyZKClient-localhost:2181@0x691a7f8f] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:java.io.tmpdir=C:\Users\95280\AppData\Local\Temp\
2023-03-30 23:51:25,201 INFO  [ReadOnlyZKClient-localhost:2181@0x691a7f8f] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:java.compiler=<NA>
2023-03-30 23:51:25,201 INFO  [ReadOnlyZKClient-localhost:2181@0x691a7f8f] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:os.name=Windows 11
2023-03-30 23:51:25,201 INFO  [ReadOnlyZKClient-localhost:2181@0x691a7f8f] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:os.arch=amd64
2023-03-30 23:51:25,201 INFO  [ReadOnlyZKClient-localhost:2181@0x691a7f8f] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:os.version=10.0
2023-03-30 23:51:25,201 INFO  [ReadOnlyZKClient-localhost:2181@0x691a7f8f] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:user.name=95280
2023-03-30 23:51:25,201 INFO  [ReadOnlyZKClient-localhost:2181@0x691a7f8f] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:user.home=C:\Users\95280
2023-03-30 23:51:25,201 INFO  [ReadOnlyZKClient-localhost:2181@0x691a7f8f] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:user.dir=D:\eclipse\Workforce\HBase\HBasExample
2023-03-30 23:51:25,202 INFO  [ReadOnlyZKClient-localhost:2181@0x691a7f8f] zookeeper.ZooKeeper (ZooKeeper.java:<init>(438)) - Initiating client connection, connectString=localhost:2181 sessionTimeout=90000 watcher=org.apache.hadoop.hbase.zookeeper.ReadOnlyZKClient$$Lambda$8/63170984@233bb9ce
2023-03-30 23:51:25,715 INFO  [ReadOnlyZKClient-localhost:2181@0x691a7f8f-SendThread(127.0.0.1:2181)] zookeeper.ClientCnxn (ClientCnxn.java:logStartConnect(1032)) - Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2023-03-30 23:51:27,747 WARN  [ReadOnlyZKClient-localhost:2181@0x691a7f8f-SendThread(127.0.0.1:2181)] zookeeper.ClientCnxn (ClientCnxn.java:run(1162)) - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:715)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1141)
2023-03-30 23:51:27,856 INFO  [ReadOnlyZKClient-localhost:2181@0x691a7f8f-SendThread(0:0:0:0:0:0:0:1:2181)] zookeeper.ClientCnxn (ClientCnxn.java:logStartConnect(1032)) - Opening socket connection to server 0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error)
2023-03-30 23:51:27,858 WARN  [ReadOnlyZKClient-localhost:2181@0x691a7f8f] zookeeper.ReadOnlyZKClient (ReadOnlyZKClient.java:exec(192)) - 0x691a7f8f to localhost:2181 failed for get of /hbase/hbaseid, code = CONNECTIONLOSS, retries = 1
2023-03-30 23:51:29,882 WARN  [ReadOnlyZKClient-localhost:2181@0x691a7f8f-SendThread(0:0:0:0:0:0:0:1:2181)] zookeeper.ClientCnxn (ClientCnxn.java:run(1162)) - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect

以下是chatgpt的分析,但是我还是解决不明白,希望各位能给出具体解决方法。

这是一个Java程序运行时出现的异常信息,可能涉及到Zookeeper分布式协调服务连接失败的问题。具体来说,该异常信息指出在连接0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181这个地址的Zookeeper服务器时发生了连接拒绝的错误,但没有进一步的信息描述。
接下来的日志信息显示,程序尝试连接Zookeeper服务器,并执行了一次获取/hbase/hbaseid数据的操作,但由于连接中断(CONNECTIONLOSS)而失败,重试了一次(retries=1)。随后又出现了一个Session错误,导致程序关闭了与Zookeeper服务器的连接并尝试重新连接。
总之,该异常信息和日志表明了一个Java程序无法连接Zookeeper服务器的问题,可能需要检查网络连接、Zookeeper服务器配置等方面的问题。

  • 写回答

3条回答 默认 最新

  • lzj01231 2023-04-03 10:56
    关注

    要制定zookeeper地址
    configuration.set("hbase.zookeeper.quorum", "172.21.55.100");

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 4月11日
  • 已采纳回答 4月3日
  • 修改了问题 4月1日
  • 创建了问题 3月31日

悬赏问题

  • ¥15 求购HI3519AV100开发板
  • ¥15 请问1553 RT怎么测试,没有BC有方法吗
  • ¥100 业务编程如何选择学习方向和内容?
  • ¥15 wamp3.3.5安装完成后图标正常显示绿色,鼠标左右键点击图标均无反应。求解决方法。
  • ¥15 鼠标点击的这条记录了什么?
  • ¥15 在写pid调速的程序时,电机始终维持最大速度
  • ¥15 【有偿】调用DXGI截图初始化失败,提示0xf 887a0004
  • ¥15 请问如何查看手机root记录?
  • ¥15 商城小程序订单号重复
  • ¥15 学校优化算法sbo和蚁群算法怎么结合