org.apache.kafka.common.errors.TimeoutException:Topic xxx not present in metadata after 60000ms.

1.发现问题:服务中向kafka的一个topic发送消息,报了这个错误

org.apache.kafka.common.errors.TimeoutException:Topic xxx not present in metadata after 60000ms.

2.排查思路:手动连接kafka,打开两个窗口一个向xxx这个topic发送消息,另一个看能否正常消费消息。

窗口1:执行发送消息命令

bin/kafka-console-producer.sh --broker-list 192.168.65.60:9092,192.168.65.60:9093,192.168.65.60:9094 --topic xxx

窗口2:消费消息

bin/kafka-console-consumer.sh --bootstrap-server 192.168.65.60:9092,192.168.65.60:9093,192.168.65.60:9094 --from-beginning --topic xxx

我再窗口1发送消息时,窗口1报了错误

Error while fetching metadata with correlation id 0 : {test=UNKNOWN_TOPIC_OR_PARTITION}

3.问题转变:现在问题变为解决当前当前不能向topic发消息:

3.1:排查问题
在kafka安装目录的 config/server.properties配置文件中修改配置

  1. kafka部署的机器ip和提供服务的端口号
#kafka部署的机器ip和提供服务的端口号
listeners=PLAINTEXT://192.168.65.60:9093  
  1. 杀死之前已经启动的kafka
ps -ef | grep kafka
kill -9 进程id
  1. 重新启动kafka
bin/kafka-server-start.sh -daemon config/server.properties
  1. 在重新发送消息,发现消息已经可以正常收到。
  2. 回到服务中,发现服务中调用报错依然存在
  3. 检查配置:项目中使用的springboot+kafka.application.yml中配置如下
spring: 
	kafka: 
		bootstrap-servers: kafka.server.com

这里因为kafka部署着集群,本来是用nginx监听这个域名,将请求转发到三台机器。但是实际上这里不能使用这个域名,应该直接配置三台机器的ip:port。修改配置如下

spring: 
	kafka: 
		bootstrap-servers: ip1:port1,ip2:port2,ip3:port3 

修改之后,重启服务,发现问题解决。

  • 6
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
09年新书,很好的知无线电 网络中的频谱接入和管理,下面是IEEE的书评: The book is divided into three parts. Part one is a general introduction to wire- less communication systems, reviewing communication architectures and tech- nologies, as well as resource allocation protocols and dynamic spectrum access, discussing features, research challenges, and standardization. Part two is a further discussion on wireless system design with a focus on analysis of dynamic spectrum access systems. A brief introduction to signal processing and optimization tech- niques is presented, as well as basics of game theory and intelligent algorithms (e.g., machine learning, genetic algo- rithms, and fuzzy logic). Finally, part three discusses in detail dynamic spec- trum access and management. Models and architectures of dynamic spectrum access are introduced and described in detail. The authors first present the cen- tralized dynamic spectrum access model, and later focus on the distributed approach. Distributed dynamic spectrum access is discussed from the algorithmic and protocol perspectives in separate chapters. Finally, a spectrum trading model is presented with its applications to wireless communications. This book is a valuable source of information for people new to the con- cept of dynamic spectrum access. Also, scientists and engineers already involved in dynamic spectrum access research will find this book a good reference source. This is one of the few books on the mar- ket related to dynamic spectrum access and cognitive radio written completely by the authors themselves. Therefore, it is very cohesive, has a very good flow, and does not repeat itself while intro- ducing new concepts, as do many edited books on a similar topic available on the market. Many concepts of dynamic spec- trum access are well systematized in the book, and the literature review is very broad and complete. One small draw- back is a bit too lengthy introduction to wireless communication systems in part two of the book (which can e

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值