1、我有3台内网机器 192.168.103.194 、 192.168.103.195、 192.168.103.196 部署了 kafka 集群;
2、还有1台内网机器 192.168.103.193 有外网ip 128.135.227.178
3、在193机器上做了防火墙策略,希望通过访问外网,可以转发到内网kafka的端口上,防火墙策略如
rule family="ipv4" source address="128.135.227.178/24" forward-port port="29092" protocol="tcp" to-port="9092" to-addr="192.168.103.194"
rule family="ipv4" source address="128.135.227.178/24" forward-port port="39092" protocol="tcp" to-port="9092" to-addr="192.168.103.195"
rule family="ipv4" source address="128.135.227.178/24" forward-port port="49092" protocol="tcp" to-port="9092" to-addr="192.168.103.196"
4、外网java服务,配置了外网的kafka地址和端口,如下
spring:
kafka:
bootstrap-servers: 128.135.227.178:29092
5、结果发现,java程序能创建topic,却不能向kafka发送消息。 不知道为什么??
Caused by: org.apache.kafka.common.errors.TimeoutException: Topic test not present in metadata after 60000 ms.
你的答案