Why I cannot connect to Kafka from outside?

前端 未结 8 2007
梦毁少年i
梦毁少年i 2020-12-02 14:19

I am running kafka on ec2 instance. So amazon ec2 instance has two ips one is internal ip and second one is for external use.

I created producer from local machine,

8条回答
  •  半阙折子戏
    2020-12-02 14:45

    Below are the steps to connect Kafka from outside of EC2 instance.

    1. Open Kafka server properties file on EC2.

      /kafka_2.11-2.0.0/config/server.properties

    2. Set the value of advertised.listeners to

      advertised.listeners=PLAINTEXT://ec2-xx-xxx-xxx-xx.compute-1.amazonaws.com:9092

      This should be your Public DNS (IPv4) of EC2 instance.

    3. Stop Kafka server.

    4. Start Kafka server to see above configuration changes in action.

    5. Now you can connect to your Kafka of EC2 instance from outside or from your localhost.

      Tried and tested on kafka_2.11-2.0.0

提交回复
热议问题