我在GCP中创建了一个虚拟机,并在其中设置了kafka。我已将通告的侦听器更改为虚拟机的外部公共IP。
但是,无论何时我尝试从本地笔记本电脑进行连接,我都会不断收到此错误。
我通过ping检查了与计算机的连接,并且得到了响应
PING 34.69.37.118 (34.69.37.118): 56 data bytes
64 bytes from 34.69.37.118: icmp_seq=0 ttl=54 time=266.223 ms
64 bytes from 34.69.37.118: icmp_seq=1 ttl=54 time=290.133 ms
64 bytes from 34.69.37.118: icmp_seq=2 ttl=54 time=264.678 ms
64 bytes from 34.69.37.118: icmp_seq=3 ttl=54 time=263.067 ms
^C
--- 34.69.37.118 ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 263.067/271.025/290.133/11.088 ms
答案 0 :(得分:1)
如果您的客户端(Kafka Producer)在VM之外,则需要公开以下内容:
listeners=INTERNAL://0.0.0.0:19092,EXTERNAL://0.0.0.0:9092
listener.security.protocol.map=INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
advertised.listeners=INTERNAL://vm-address:19092,EXTERNAL://host-address:9092
inter.broker.listener.name=INTERNAL
现在,您的制作人应该使用19092