Failed to resolve 'kafka:9092': Name or service not known - docker / php-rdkafka

前端 未结 1 1044
北荒
北荒 2021-02-06 04:40

I am trying to get php connecting to kafka all within a docker container.

kafka php lib - https://github.com/arnaud-lb/php-rdkafka/

kafk

相关标签:
1条回答
  • 2021-02-06 05:05

    The brokers will advertise themselve using advertised.listeners (which seems to be abstracted with KAFKA_ADVERTISED_HOST_NAME in that docker image) and the clients will consequently try to connect to these advertised hosts and ports.

    You will thus need to make sure the client can resolve and reach this advertised hostnames, e.g. by adding "kafka" to /etc/hosts on the client host.

    0 讨论(0)
提交回复
热议问题