场景:
1、有多套环境
2、多套环境之间做了网络隔离
3、在环境1部署了etcd和kafka
4、想要在其它环境连接到环境1的etcd和kafka
方案:
1、分别申请vip指向etcd和kafka 的realserver ip和端口
2、开通其余环境到vip的网络策略
结果:
1、etcd成功
2、kafka-producer在建立连接的时候成功,发送数据的时候失败:
[root@xixixi kafka_2.13-2.6.0]# bin/kafka-console-producer.sh --bootstrap-server vip:9092 --topic test
>123
[2021-06-10 15:40:36,254] WARN [Producer clientId=console-producer] Connection to node 1 (/ip1:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
[2021-06-10 15:40:39,357] WARN [Producer clientId=console-producer] Connection to node 2 (/ip2:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
[2021-06-10 15:40:42,460] WARN [Producer clientId=console-producer] Connection to node 3 (/ip3:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)

最低0.47元/天 解锁文章
745

被折叠的 条评论
为什么被折叠?



