Leader Not Available Kafka in Console Producer

前端 未结 24 2620
野趣味
野趣味 2020-12-07 07:47

I am trying to use Kafka.
All configurations are done properly but when I try to produce message from console I keep getting the following error

WARN Err         


        
24条回答
  •  清歌不尽
    2020-12-07 08:17

    I'm using kafka_2.12-0.10.2.1:

    vi config/server.properties

    add below line:

    listeners=PLAINTEXT://localhost:9092
    
    • No need to change the advertised.listeners as it picks up the value from std listener property.

    Hostname and port the broker will advertise to producers and consumers. If not set,

    • it uses the value for "listeners" if configured

    Otherwise, it will use the value returned from java.net.InetAddress.getCanonicalHostName().

    stop the Kafka broker:

    bin/kafka-server-stop.sh
    

    restart broker:

    bin/kafka-server-start.sh -daemon config/server.properties
    

    and now you should not see any issues.

提交回复
热议问题