zoukankan      html  css  js  c++  java
  • 报错:Zookeeper Unable to open socket to localhost/0:0:0:0:0:0:0:1:2181

    报错背景

    单节点zokeeper

    进入zookeeper客户端的时候报错:zkCli.sh

    报错现象

    2020-07-03 18:39:47,943 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1112] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error)
    JLine support is enabled
    2020-07-03 18:39:48,011 [myid:localhost:2181] - ERROR [main-SendThread(localhost:2181):ClientCnxnSocketNIO@287] - Unable to open socket to localhost/0:0:0:0:0:0:0:1:2181
    2020-07-03 18:39:48,011 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1244] - Socket error occurred: localhost/0:0:0:0:0:0:0:1:2181: No route to host
    [zk: localhost:2181(CONNECTING) 0] 2020-07-03 18:39:49,114 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1112] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error)
    2020-07-03 18:39:49,114 [myid:localhost:2181] - ERROR [main-SendThread(localhost:2181):ClientCnxnSocketNIO@287] - Unable to open socket to localhost/0:0:0:0:0:0:0:1:2181
    2020-07-03 18:39:49,114 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1244] - Socket error occurred: localhost/0:0:0:0:0:0:0:1:2181: No route to host
    2020-07-03 18:39:50,216 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1112] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
    2020-07-03 18:39:50,217 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@959] - Socket connection established, initiating session, client: /127.0.0.1:57616, server: localhost/127.0.0.1:2181
    2020-07-03 18:39:50,224 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1394] - Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x10005b5b80d0005, negotiated timeout = 160000
    
    WATCHER::
    
    WatchedEvent state:SyncConnected type:None path:null

    报错原因

    (1)zookeeper中少配了主机名的映射;

    (2)hosts文件出现问题。

    报错解决

    先检查/etc/hosts文件中IP和主机名的映射是否正确;

    再检查/opt/apache-zookeeper-3.5.6-bin/conf/目录下zoo.cfg文件有没有添加如下内容,如没有,则添上:

    server.1=hadoop01:2888:3888
  • 相关阅读:
    Docker学习笔记(一)——安装
    Mac安装Nginx
    Spring Boot学习笔记(二)——HelloWorld实现
    Spring Boot学习笔记(一)——Eclipse安装STS插件
    Redis学习笔记(九)——集群
    Redis学习笔记(八)——持久化
    Redis学习笔记(七)——数据结构之有序集合(sorted set)
    Redis学习笔记(六)——数据结构之Set
    Redis学习笔记(五)——数据结构之哈希(Hash)
    Redis学习笔记(四)——数据结构之List
  • 原文地址:https://www.cnblogs.com/chuijingjing/p/13580931.html
Copyright © 2011-2022 走看看