即使配置了播发侦听器,也无法连接到远程kafka代理

jei2mxaa  于 2021-06-05  发布在  Kafka
关注(0)|答案(1)|浏览(419)

我在gcp中创建了一个vm,并在其中设置了kafka。我已将播发的侦听器更改为vm的外部公共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
ac1kyiln

ac1kyiln1#

如果您的客户机(kafka producer)位于虚拟机之外,则需要公开以下内容:

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

相关问题