1.报错详情
此问题仅出现在云服务器上,非云服务器未出现过一下报错:
15:50:26.736 [kafka-producer-network-thread | producer-1] WARN o.a.k.c.NetworkClient - [processDisconnection,782] - [Producer clientId=producer-1] Connection to node -1 (/xxx.xx.xxx.xxx:9092) could not be established. Broker may not be available.
2.配置问题
非云服务器:
# 报错时仅配置了 listeners=PLAINTEXT://IP:9092
云服务器:
# 处理后 listeners=PLAINTEXT://云服务器IP:9092 advertised.listeners=PLAINTEXT://云服务器外网IP:9092
3.总结
- 云服务器有两个IP,监听IP为云服务器IP,而advertised监听IP为云服务器的外网IP。