Hello,
        Thanks for your reply. And my net topology is as the attach picture.
        The node1's configuration is as below. The others are similar.

        listeners=INTERNAL://0.0.0.0:9092,EXTERNAL://0.0.0.0:9001
        listener.security.protocol.map=INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
        
advertised.listeners=EXTERNAL://172.16.0.13:9001,INTERNAL://172.20.1.11:9092
        inter.broker.listener.name=INTERNAL

        I want Kafka to broadcast 
"172.16.0.13:9001,172.16.0.13:9002,172.16.0.13:9003,172.16.0.13:9004,172.16.0.13:9005"
 to the clients. But it can't!
        Here is some output of rdkafka_examle in librdkafka.

        Metadata for all topics (from broker -1: 172.16.0.13:9001/bootstrap):
         5 brokers:
                broker 2 at 172.20.1.12:9092
                broker 5 at 172.20.1.15:9092
                broker 4 at 172.20.1.14:9092
                broker 1 at 172.20.1.11:9092
                broker 3 at 172.20.1.13:9092

-----邮件原件-----
发件人: Robin Moffatt [mailto:ro...@confluent.io] 
发送时间: 2018年9月17日 21:51
收件人: users@kafka.apache.org
主题: Re: How to config the servers when Kafka cluster is behind a NAT?

This should help: https://rmoff.net/2018/08/02/kafka-listeners-explained/


-- 

Robin Moffatt | Developer Advocate | ro...@confluent.io | @rmoff


On Mon, 17 Sep 2018 at 12:18, XinYi Long <xinyil...@skspruce.net> wrote:

> Hello, Guys,
>
>     I have a Kafka cluster, which is behind a NAT.
>
>     I have some devices on the internet, to play as consumers and 
> producers. And I also have some applications which are in the same LAN 
> with the Kafka cluster, and play as consumers and producers.
>
>     I have changed the "advertised.listeners" to "PLAINTEXT://{NAT 
> IP}:{NAT port}", and add some routes on the servers. Because I found 
> that Kafka brokers also use the "advertised.listeners" to talk with each 
> other.
> Am I right?
>
>     When I start a consumer in the same LAN, I found it can receive 
> metadata correctly. But it can't consume any message from other 
> producer in the same LAN.
>
>     Did I miss anything, and how to make it work?
>
>
> Thank you very much!
>
>
> lxyscls
>

Reply via email to