返回到文章

采纳

编辑于

springboot客户端用外网访问一个服务器,再通过这个服务器的3个端口映射到内部的3台服务器listeners属性该如何设置?

kafka

大佬我又来了...还望费心看看我已经要觉悟了.先谢过了

问题描述:
由于环境限制.我现在只有一台服务器(a)可以通过外网ip进行访问,另外三台服务器(b,c,d)都得通过ssh命令从a跳转到b,c,d.那好.(以下ip地址均由a,b,c,d代替)
我的kafak集群和zookeeper集群都是部署在 b,c,d上边的.
a已经做好了ip和端口的映射分别是 :

a:9090->b:9092
a:9091->c:9092
a:9092->d:9092

然后这时候我用springboot整合kafka之后打算发消息测试好不好使

spring:
  kafka:
#    bootstrap-servers: a:9090
#    bootstrap-servers: a:9090,a:9091,a:9092

这几种ip配置的方式我都试过了...都会报一个错


2018-12-04 16:59:19.408  INFO 15452 --- [ntainer#1-1-C-1] o.a.k.c.c.internals.AbstractCoordinator  : [Consumer clientId=consumer-7, groupId=test2] Group coordinator 10.20.129.161:9090 (id: 2147483486 rack: null) is unavailable or invalid, will attempt rediscovery
2018-12-04 16:59:19.476  WARN 15452 --- [ntainer#1-2-C-1] org.apache.kafka.clients.NetworkClient   : [Consumer clientId=consumer-8, groupId=test2] Connection to node 2147483486 could not be established. Broker may not be available.




2018-12-04 16:59:20.327  WARN 15452 --- [ntainer#0-1-C-1] org.apache.kafka.clients.NetworkClient   : [Consumer clientId=consumer-3, groupId=test2] Connection to node 161 could not be established. Broker may not be available.
2018-12-04 16:59:20.347  WARN 15452 --- [ntainer#0-0-C-1] org.apache.kafka.clients.NetworkClient   : [Consumer clientId=consumer-2, groupId=test2] Connection to node 181 could not be established. Broker may not be available.
2018-12-04 16:59:20.446  WARN 15452 --- [ntainer#1-0-C-1] org.apache.kafka.clients.NetworkClient   : [Consumer clientId=consumer-6, groupId=test2] Connection to node 171 could not be

b,c,d的id分别是161,171,181, 这个时候应该说明它已经通过a映射到了b,c,d了吧但是怎么就是连不上呢....