kafka broker not available at starting

后端 未结 10 908
陌清茗
陌清茗 2020-12-28 14:33

I set on a ubuntu node of a cluster a kafka 0.11.0.0 instance. Until some weeks ago everything worked fine, today I\'m trying to starting it and I obtain this error after th

10条回答
  •  旧时难觅i
    2020-12-28 15:35

    I also had the same issue...

    So I start by asking Zookeeper some data

    echo dump | nc localhost 2181
    

    I get back something like this

    SessionTracker dump:
    Session Sets (3):
    0 expire at Sun Dec 03 18:15:48 GST 2017:
    0 expire at Sun Dec 03 18:15:51 GST 2017:
    1 expire at Sun Dec 03 18:15:54 GST 2017:
    0x1601c9a25190000
    ephemeral nodes dump:
    Sessions with Ephemerals (1):
    0x1601c9a25190000:
    /controller
    /brokers/ids/0
    

    I read this to mean that I have 1 Broker available - and it is has an id of 0.

    So, lets find about that broker.

    bin/zookeeper-shell.sh localhost:2181 <<< "get /brokers/ids/0"
    

    And I see

    {"listener_security_protocol_map":{"PLAINTEXT":"PLAINTEXT"},"endpoints":["PLAINTEXT://192.168.1.220:9092"],"jmx_port":-1,"host":"192.168.1.220","timestamp":"1512308520781","port":9092,"version":4}
    cZxid = 0x69
    ctime = Sun Dec 03 17:42:00 GST 2017
    mZxid = 0x69
    mtime = Sun Dec 03 17:42:00 GST 2017
    pZxid = 0x69
    cversion = 0
    dataVersion = 0
    aclVersion = 0
    ephemeralOwner = 0x1601c9a25190000
    dataLength = 196
    numChildren = 0
    

    This rather startled me ... PLAINTEXT://192.168.1.220:9092, so when I changed my connect string to read

    bin/kafka-console-producer.sh  --broker-list PLAINTEXT://192.168.1.220:9092  --topic test
    

    It all now worked.

    Good luck !!

提交回复
热议问题