本地producer和consumer连接不上远程kafka服务

Hostname and port the broker will advertise to producers and consumers. If not set, it uses the value for “listeners” if configured. Otherwise, it will use the value returned from java.net.InetAddress.getCanonicalHostName(). advertised.listeners=PLAINTEXT://ip:9092

打开advertised.listeners=PLAINTEXT://ip:9092配置,ip为kafka服务ip