彻底解决RocketMq问题之No route info of this topic以及org.apache.rocketmq.remoting.exception.RemotingTooMuch异常

    技术2022-07-10  145

    如果你和我一样遇到了这样的rocketMQ异常:No route info of this topic 还有 org.apache.rocketmq.remoting.exception.RemotingTooMuchRequestException: sendDefaultImpl call timeout的异常就往下看吧,踩了4个多小时的坑,哭了…

    No route info of this topic xx异常

    看了网上很多解决方案,这个异常主要可能有几种情况:

    broker没有注册到nameserverproducer没有连到nameserver(很可能防火墙问题)topic没有创建

    【情况1】运行命令:sh mqadmin clusterList -n localhost:9876

    看到这种说明正常,看看第二种有没有问题

    【情况2】运行命令:systemctl stop firewalld.service

    Failed to stop firewalld.service: Unit firewalld.service not loaded.

    说明我们的防火墙已经关闭了,不是这个问题

    【情况3】运行命令:sh mqadmin topicstatus -n 公网ip:9876 -t 你的topic名称

    发现topic没有创建,那我们手动创建一个不就好了嘛

    sh mqadmin updateTopic -n localhost:9876 -b localhost:10911 -t 你的topic名称

    唉就在我感慨这个错误不见了的时候,又变成下面一个错误了????

    org.apache.rocketmq.remoting.exception.RemotingTooMuchRequestException: sendDefaultImpl call timeout异常

    查了半天问题,最后发现是rocketmq官网上的教程有点坑,启动broker

    不能写localhost啊!!!要写你服务器的公网ip】

    nohup sh bin/mqnamesrv -n 你的公网IP:9876 &

    修改conf/broker.conf 加上一句

    启动broker:

    nohup sh bin/mqbroker -n 你的公网IP:9876 -c conf/broker.conf autoCreateTopicEnable=true &

    完美解决!

    Processed: 0.010, SQL: 9