Kafka access inside and outside docker

前端 未结 3 1068
遥遥无期
遥遥无期 2020-12-18 00:22

I\'m trying to start a kafka service using docker-compose, and it should be able to be accessed inside and outside docker. So, it should be matter of setting the right adver

3条回答
  •  时光说笑
    2020-12-18 01:06

    Your config of the listeners looks correct, the problem is with your Docker Compose:

    ports:
      - "9094:9092"
    

    You’re mapping 9094 (‘Outside’) back to 9092 (‘Inside’) and thus when you connect you’re connecting to the ‘Inside’ listener. If you remove this line of config then your listener set up should work as intended.

    For more info, see http://rmoff.net/2018/08/02/kafka-listeners-explained/

提交回复
热议问题