spring cloud bus 配置服务端无法连接kafka
Greenwich.M3版本,下面是针对spring cloud bus导入的maven依赖:
对应于配置中心相关的配置:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bus-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-bus</artifactId>
</dependency>
对应的配置端代码:
spring.cloud.bus.enabled=true
spring.kafka.bootstrap-servers=xxx:9092
management.endpoints.web.exposure.include=*
spring.cloud.bus.refresh.enabled=true
16 22:38:48.949 INFO 13948 --- [ main] o.a.kafka.common.utils.AppInfoParser : Kafka version : 2.0.1
2019-03-16 22:38:48.949 INFO 13948 --- [ main] o.a.kafka.common.utils.AppInfoParser : Kafka commitId : fa14705e51bd2ce5
2019-03-16 22:38:50.440 WARN 13948 --- [| adminclient-1] org.apache.kafka.clients.NetworkClient : [AdminClient clientId=adminclient-1] Connection to node 1001 could not be established. Broker may not be available.
2019-03-16 22:38:51.551 WARN 13948 --- [| adminclient-1] org.apache.kafka.clients.NetworkClient : [AdminClient clientId=adminclient-1] Connection to node 1001 could not be established. Broker may not be available.
2019-03-16 22:38:52.660 WARN 13948 --- [| adminclient-1] org.apache.kafka.clients.NetworkClient : [AdminClient clientId=adminclient-1] Connection to node 1001 could not be established. Broker may not be available.
2019-03-16 22:38:53.972 WARN 13948 --- [| adminclient-1] org.apache.kafka.clients.NetworkClient : [AdminClient clientId=adminclient-1] Connection to node 1001 could not be established. Broker may not be available.
2019-03-16 22:38:55.376 WARN 13948 --- [| adminclient-1] org.apache.kafka.clients.NetworkClient : [AdminClient clientId=adminclient-1] Connection to node 1001 could not be established. Broker may not be available.
2019-03-16 22:38:57.400 WARN 13948 --- [| adminclient-1] org.apache.kafka.clients.NetworkClient : [AdminClient clientId=adminclient-1] Connection to node 1001 could not be established. Broker may not be available.
2019-03-16 22:38:59.521 WARN 13948 --- [| adminclient-1] org.apache.kafka.clients.NetworkClient : [AdminClient clientId=adminclient-1] Connection to node 1001 could not be established. Broker may not be available.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查下kafka broker是否异常,进程是否还在。
可以在当前机器下 telnet brokerip 9092 看能否连接上。
Kafka服务(broker)无法连接,检查一下Kafka是否允许外部主机访问
advertised.listeners=PLAINTEXT://你的Kafka主机IP:9092