kafka-python: producer is not able to connect

后端 未结 7 2143
你的背包
你的背包 2020-12-16 00:29

kafka-python (1.0.0) throws error while connecting to the broker. At the same time /usr/bin/kafka-console-producer and /usr/bin/kafka-console-consumer work fine.

Pyt

7条回答
  •  眼角桃花
    2020-12-16 01:07

    In your server.properties file make sure he Listener IP is set to your box Ip address which is accessible to remote machine. By default it is localhost

    Update this line in your server.properties:

    listeners=PLAINTEXT://:9092
    

    Also make sure you don't have a firewall which might be blocking other IP addresses to reach you. If you have sudo previleges. The try disabling the firewall.

    sudo systemctl stop firewalld
    

提交回复
热议问题