工具配置成功并且启动成功了,但与springboot集成的时候一直报这个错误
来源:9-5 搭建RocketMQ

weixin_慕盖茨9194315
2020-10-13
工具配置成功并且启动成功了,但与springboot集成的时候一直报这个错误
{
"timestamp": "2020-10-11T08:49:43.588+0000",
"status": 500,
"error": "Internal Server Error",
"message": "Send [3] times, still failed, cost [22]ms, Topic: add-bonus, BrokersSent: [DESKTOP-EUT35OQ, DESKTOP-EUT35OQ, DESKTOP-EUT35OQ]\nSee http://rocketmq.apache.org/docs/faq/ for further details.; nested exception is org.apache.rocketmq.client.exception.MQClientException: Send [3] times, still failed, cost [22]ms, Topic: add-bonus, BrokersSent: [DESKTOP-EUT35OQ, DESKTOP-EUT35OQ, DESKTOP-EUT35OQ]\nSee http://rocketmq.apache.org/docs/faq/ for further details.",
"path": "/admin/shares/audit/2"
}
org.springframework.messaging.MessagingException: sendDefaultImpl call timeout; nested exception is org.apache.rocketmq.remoting.exception.RemotingTooMuchRequestException: sendDefaultImpl call timeout
2020-10-13 12:24:45 INFO main - tls.client.keyPassword = null
2020-10-13 12:24:45 INFO main - tls.client.certPath = null
2020-10-13 12:24:45 INFO main - tls.client.authServer = false
2020-10-13 12:24:45 INFO main - tls.client.trustCertPath = null
2020-10-13 12:24:46 INFO main - Using OpenSSL provider
2020-10-13 12:24:47 INFO main - SSLContext created for server
2020-10-13 12:24:47 INFO main - Try to start service thread:FileWatchService started:false lastThread:null
2020-10-13 12:24:47 INFO NettyEventExecutor - NettyEventExecutor service started
2020-10-13 12:24:47 INFO main - The Name Server boot success. serializeType=JSON
2020-10-13 12:24:47 INFO FileWatchService - FileWatchService service started
2020-10-13 12:25:00 INFO NettyServerCodecThread_1 - NETTY SERVER PIPELINE: channelRegistered 127.0.0.1:49652
2020-10-13 12:25:00 INFO NettyServerCodecThread_1 - NETTY SERVER PIPELINE: channelActive, the channel[127.0.0.1:49652]
2020-10-13 12:25:00 INFO NettyServerCodecThread_1 - NETTY SERVER PIPELINE: channelInactive, the channel[127.0.0.1:49652]
2020-10-13 12:25:00 INFO NettyServerCodecThread_1 - NETTY SERVER PIPELINE: channelUnregistered, the channel[127.0.0.1:49652]
2020-10-13 12:25:30 INFO NettyServerCodecThread_2 - NETTY SERVER PIPELINE: channelRegistered 127.0.0.1:49654
2020-10-13 12:25:30 INFO NettyServerCodecThread_2 - NETTY SERVER PIPELINE: channelActive, the channel[127.0.0.1:49654]
2020-10-13 12:25:30 INFO NettyServerCodecThread_2 - NETTY SERVER PIPELINE: channelInactive, the channel[127.0.0.1:49654]
2020-10-13 12:25:30 INFO NettyServerCodecThread_2 - NETTY SERVER PIPELINE: channelUnregistered, the channel[127.0.0.1:49654]
2020-10-13 12:25:42 INFO NettyServerCodecThread_3 - NETTY SERVER PIPELINE: channelRegistered 47.101.167.214:52582
2020-10-13 12:25:42 INFO NettyServerCodecThread_3 - NETTY SERVER PIPELINE: channelActive, the channel[47.101.167.214:52582]
2020-10-13 12:25:42 INFO RemotingExecutorThread_4 - new topic registered, RMQ_SYS_TRANS_HALF_TOPIC QueueData [brokerName=iZuf6h6yzsw5uybsq1y7w8Z, readQueueNums=1, writeQueueNums=1, perm=6, topicSynFlag=0]
2020-10-13 12:25:42 INFO RemotingExecutorThread_4 - new topic registered, BenchmarkTest QueueData [brokerName=iZuf6h6yzsw5uybsq1y7w8Z, readQueueNums=1024, writeQueueNums=1024, perm=6, topicSynFlag=0]
2020-10-13 12:25:42 INFO RemotingExecutorThread_4 - new topic registered, OFFSET_MOVED_EVENT QueueData [brokerName=iZuf6h6yzsw5uybsq1y7w8Z, readQueueNums=1, writeQueueNums=1, perm=6, topicSynFlag=0]
2020-10-13 12:25:42 INFO RemotingExecutorThread_4 - new topic registered, iZuf6h6yzsw5uybsq1y7w8Z QueueData [brokerName=iZuf6h6yzsw5uybsq1y7w8Z, readQueueNums=1, writeQueueNums=1, perm=7, topicSynFlag=0]
2020-10-13 12:25:42 INFO RemotingExecutorThread_4 - new topic registered, TBW102 QueueData [brokerName=iZuf6h6yzsw5uybsq1y7w8Z, readQueueNums=8, writeQueueNums=8, perm=7, topicSynFlag=0]
2020-10-13 12:25:42 INFO RemotingExecutorThread_4 - new topic registered, SELF_TEST_TOPIC QueueData [brokerName=iZuf6h6yzsw5uybsq1y7w8Z, readQueueNums=1, writeQueueNums=1, perm=6, topicSynFlag=0]
2020-10-13 12:25:42 INFO RemotingExecutorThread_4 - new topic registered, DefaultCluster QueueData [brokerName=iZuf6h6yzsw5uybsq1y7w8Z, readQueueNums=16, writeQueueNums=16, perm=7, topicSynFlag=0]
2020-10-13 12:25:42 INFO RemotingExecutorThread_4 - new broker registered, 172.19.172.31:10911 HAServer: 172.19.172.31:10912
2020-10-13 12:25:47 INFO NSScheduledThread1 - --------------------------------------------------------
2020-10-13 12:25:47 INFO NSScheduledThread1 - configTable SIZE: 0
2020-10-13 12:26:00 INFO NettyServerCodecThread_4 - NETTY SERVER PIPELINE: channelRegistered 127.0.0.1:49658
2020-10-13 12:26:00 INFO NettyServerCodecThread_4 - NETTY SERVER PIPELINE: channelActive, the channel[127.0.0.1:49658]
2020-10-13 12:26:00 INFO NettyServerCodecThread_4 - NETTY SERVER PIPELINE: channelInactive, the channel[127.0.0.1:49658]
2020-10-13 12:26:00 INFO NettyServerCodecThread_4 - NETTY SERVER PIPELINE: channelUnregistered, the channel[127.0.0.1:49658]
2020-10-13 12:26:28 INFO NettyServerCodecThread_5 - NETTY SERVER PIPELINE: channelRegistered 36.7.84.116:61751
2020-10-13 12:26:28 INFO NettyServerCodecThread_5 - NETTY SERVER PIPELINE: channelActive, the channel[36.7.84.116:61751]
2020-10-13 12:26:28 INFO NettyServerCodecThread_6 - NETTY SERVER PIPELINE: channelRegistered 36.7.84.116:61750
2020-10-13 12:26:28 INFO NettyServerCodecThread_6 - NETTY SERVER PIPELINE: channelActive, the channel[36.7.84.116:61750]
2020-10-13 12:26:30 INFO NettyServerCodecThread_7 - NETTY SERVER PIPELINE: channelRegistered 127.0.0.1:49662
2020-10-13 12:26:30 INFO NettyServerCodecThread_7 - NETTY SERVER PIPELINE: channelActive, the channel[127.0.0.1:49662]
2020-10-13 12:26:30 INFO NettyServerCodecThread_7 - NETTY SERVER PIPELINE: channelInactive, the channel[127.0.0.1:49662]
2020-10-13 12:26:30 INFO NettyServerCodecThread_7 - NETTY SERVER PIPELINE: channelUnregistered, the channel[127.0.0.1:49662]
2020-10-13 12:26:37 INFO NettyServerCodecThread_5 - NETTY SERVER PIPELINE: channelInactive, the channel[36.7.84.116:61751]
2020-10-13 12:26:37 INFO NettyServerCodecThread_5 - NETTY SERVER PIPELINE: channelUnregistered, the channel[36.7.84.116:61751]
2020-10-13 12:26:40 INFO NettyServerCodecThread_6 - NETTY SERVER PIPELINE: channelInactive, the channel[36.7.84.116:61750]
2020-10-13 12:26:40 INFO NettyServerCodecThread_6 - NETTY SERVER PIPELINE: channelUnregistered, the channel[36.7.84.116:61750]
2020-10-13 12:27:00 INFO NettyServerCodecThread_8 - NETTY SERVER PIPELINE: channelRegistered 127.0.0.1:49666
2020-10-13 12:27:00 INFO NettyServerCodecThread_8 - NETTY SERVER PIPELINE: channelActive, the channel[127.0.0.1:49666]
2020-10-13 12:27:00 INFO NettyServerCodecThread_8 - NETTY SERVER PIPELINE: channelInactive, the channel[127.0.0.1:49666]
2020-10-13 12:27:00 INFO NettyServerCodecThread_8 - NETTY SERVER PIPELINE: channelUnregistered, the channel[127.0.0.1:49666]
2020-10-13 12:20:02 INFO main - The broker[iZuf6h6yzsw5uybsq1y7w8Z, 172.19.172.31:10911] boot success. serializeType=JSON and name server is 172.19.172.31:9876
2020-10-13 12:20:11 INFO BrokerControllerScheduledThread1 - dispatch behind commit log 0 bytes
2020-10-13 12:20:11 INFO BrokerControllerScheduledThread1 - Slave fall behind master: 0 bytes
2020-10-13 12:20:12 INFO brokerOutApi_thread_2 - register broker[0]to name server 172.19.172.31:9876 OK
2020-10-13 12:20:42 INFO brokerOutApi_thread_3 - register broker[0]to name server 172.19.172.31:9876 OK
2020-10-13 12:21:11 INFO BrokerControllerScheduledThread1 - dispatch behind commit log 0 bytes
2020-10-13 12:21:11 INFO BrokerControllerScheduledThread1 - Slave fall behind master: 0 bytes
2020-10-13 12:21:12 INFO brokerOutApi_thread_4 - register broker[0]to name server 172.19.172.31:9876 OK
2020-10-13 12:21:42 INFO brokerOutApi_thread_1 - register broker[0]to name server 172.19.172.31:9876 OK
2020-10-13 12:22:11 INFO BrokerControllerScheduledThread1 - dispatch behind commit log 0 bytes
2020-10-13 12:22:11 INFO BrokerControllerScheduledThread1 - Slave fall behind master: 0 bytes
2020-10-13 12:22:12 INFO brokerOutApi_thread_2 - register broker[0]to name server 172.19.172.31:9876 OK
2020-10-13 12:22:42 INFO brokerOutApi_thread_3 - register broker[0]to name server 172.19.172.31:9876 OK
2020-10-13 12:23:11 INFO BrokerControllerScheduledThread1 - dispatch behind commit log 0 bytes
2020-10-13 12:23:11 INFO BrokerControllerScheduledThread1 - Slave fall behind master: 0 bytes
2020-10-13 12:23:12 INFO brokerOutApi_thread_4 - register broker[0]to name server 172.19.172.31:9876 OK
2020-10-13 12:23:40 INFO ShutdownHook - Shutdown hook was invoked, 1
2020-10-13 12:23:40 INFO ShutdownHook - Try to shutdown service thread:PullRequestHoldService started:true lastThread:Thread[PullRequestHoldService,5,main]
2020-10-13 12:23:40 INFO ShutdownHook - shutdown thread PullRequestHoldService interrupt false
2020-10-13 12:23:40 INFO PullRequestHoldService - PullRequestHoldService service end
2020-10-13 12:23:40 INFO ShutdownHook - join thread PullRequestHoldService eclipse time(ms) 2 90000
2020-10-13 12:23:42 INFO brokerOutApi_thread_1 - register broker[0]to name server 172.19.172.31:9876 OK
2020-10-13 12:23:44 INFO ShutdownHook - Try to shutdown service thread:FileWatchService started:true lastThread:Thread[FileWatchService,5,main]
2020-10-13 12:23:44 INFO ShutdownHook - shutdown thread FileWatchService interrupt false
2020-10-13 12:23:44 INFO FileWatchService - FileWatchService service end
2020-10-13 12:23:44 INFO ShutdownHook - join thread FileWatchService eclipse time(ms) 0 90000
2020-10-13 12:23:45 INFO ShutdownHook - Try to shutdown service thread:HAClient started:true lastThread:Thread[HAClient,5,main]
2020-10-13 12:23:45 INFO ShutdownHook - shutdown thread HAClient interrupt false
2020-10-13 12:23:45 INFO ShutdownHook - join thread HAClient eclipse time(ms) 1 90000
2020-10-13 12:23:45 INFO ShutdownHook - Try to shutdown service thread:AcceptSocketService started:true lastThread:Thread[AcceptSocketService,5,main]
2020-10-13 12:23:45 INFO ShutdownHook - shutdown thread AcceptSocketService interrupt true
2020-10-13 12:23:45 INFO ShutdownHook - join thread AcceptSocketService eclipse time(ms) 0 90000
2020-10-13 12:23:45 INFO ShutdownHook - Try to shutdown service thread:GroupTransferService started:true lastThread:Thread[GroupTransferService,5,main]
2020-10-13 12:23:45 INFO ShutdownHook - shutdown thread GroupTransferService interrupt false
2020-10-13 12:23:45 INFO ShutdownHook - join thread GroupTransferService eclipse time(ms) 1 90000
2020-10-13 12:23:45 INFO ShutdownHook - Try to shutdown service thread:StoreStatsService started:true lastThread:Thread[StoreStatsService,5,main]
2020-10-13 12:23:45 INFO ShutdownHook - shutdown thread StoreStatsService interrupt false
2020-10-13 12:23:45 INFO ShutdownHook - join thread StoreStatsService eclipse time(ms) 0 90000
2020-10-13 12:23:45 INFO ShutdownHook - Try to shutdown service thread:FlushRealTimeService started:true lastThread:Thread[FlushRealTimeService,5,main]
2020-10-13 12:23:45 INFO ShutdownHook - shutdown thread FlushRealTimeService interrupt false
2020-10-13 12:23:45 INFO ShutdownHook - join thread FlushRealTimeService eclipse time(ms) 0 300000
2020-10-13 12:23:45 INFO ShutdownHook - Try to shutdown service thread:ReputMessageService started:true lastThread:Thread[ReputMessageService,5,main]
2020-10-13 12:23:45 INFO ShutdownHook - shutdown thread ReputMessageService interrupt false
2020-10-13 12:23:45 INFO ShutdownHook - join thread ReputMessageService eclipse time(ms) 14 90000
2020-10-13 12:23:45 INFO ShutdownHook - Try to shutdown service thread:FlushConsumeQueueService started:true lastThread:Thread[FlushConsumeQueueService,5,main]
2020-10-13 12:23:45 INFO ShutdownHook - shutdown thread FlushConsumeQueueService interrupt false
2020-10-13 12:23:45 INFO ShutdownHook - join thread FlushConsumeQueueService eclipse time(ms) 26 60000
2020-10-13 12:23:45 INFO ShutdownHook - Try to shutdown service thread:AllocateMappedFileService started:true lastThread:Thread[AllocateMappedFileService,5,main]
2020-10-13 12:23:45 INFO ShutdownHook - shutdown thread AllocateMappedFileService interrupt true
2020-10-13 12:23:45 INFO ShutdownHook - join thread AllocateMappedFileService eclipse time(ms) 1 90000
2020-10-13 12:23:45 INFO ShutdownHook - unregisterBroker OK, NamesrvAddr: 172.19.172.31:9876
2020-10-13 12:23:45 INFO ShutdownHook - Try to shutdown service thread:FileWatchService started:false lastThread:Thread[FileWatchService,5,]
2020-10-13 12:23:45 INFO ShutdownHook - Try to shutdown service thread:TransactionalMessageCheckService started:true lastThread:Thread[TransactionalMessageCheckService,5,main]
2020-10-13 12:23:45 INFO ShutdownHook - shutdown thread TransactionalMessageCheckService interrupt false
2020-10-13 12:23:45 INFO ShutdownHook - join thread TransactionalMessageCheckService eclipse time(ms) 8 90000
2020-10-13 12:23:45 INFO ShutdownHook - Shutdown hook over, consuming total time(ms): 5132
^C
[1]+ 退出 143 nohup sh bin/mqbroker -n 172.19.172.31:9876
[root@iZuf6h6yzsw5uybsq1y7w8Z rocketmq-all-4.5.1-bin-release]# nohup sh bin/mqbroker -n 47.101.167.214:9876 &
[1] 2850
[root@iZuf6h6yzsw5uybsq1y7w8Z rocketmq-all-4.5.1-bin-release]# nohup: 忽略输入并把输出追加到"nohup.out"
[root@iZuf6h6yzsw5uybsq1y7w8Z rocketmq-all-4.5.1-bin-release]# tail -f ~/logs/rocketmqlogs/broker.log
2020-10-13 12:25:41 INFO main - Try to start service thread:FlushConsumeQueueService started:false lastThread:null
2020-10-13 12:25:41 INFO main - Try to start service thread:FlushRealTimeService started:false lastThread:null
2020-10-13 12:25:41 INFO main - Try to start service thread:StoreStatsService started:false lastThread:null
2020-10-13 12:25:42 INFO main - Try to start service thread:FileWatchService started:false lastThread:null
2020-10-13 12:25:42 INFO main - Try to start service thread:PullRequestHoldService started:false lastThread:null
2020-10-13 12:25:42 INFO FileWatchService - FileWatchService service started
2020-10-13 12:25:42 INFO PullRequestHoldService - PullRequestHoldService service started
2020-10-13 12:25:42 INFO main - Try to start service thread:TransactionalMessageCheckService started:false lastThread:null
2020-10-13 12:25:43 INFO brokerOutApi_thread_1 - register broker[0]to name server 47.101.167.214:9876 OK
2020-10-13 12:25:43 INFO main - The broker[iZuf6h6yzsw5uybsq1y7w8Z, 172.19.172.31:10911] boot success. serializeType=JSON and name server is 47.101.167.214:9876
2020-10-13 12:25:51 INFO BrokerControllerScheduledThread1 - dispatch behind commit log 0 bytes
2020-10-13 12:25:51 INFO BrokerControllerScheduledThread1 - Slave fall behind master: 0 bytes
2020-10-13 12:25:53 INFO brokerOutApi_thread_2 - register broker[0]to name server 47.101.167.214:9876 OK
2020-10-13 12:26:23 INFO brokerOutApi_thread_3 - register broker[0]to name server 47.101.167.214:9876 OK
2020-10-13 12:26:51 INFO BrokerControllerScheduledThread1 - dispatch behind commit log 0 bytes
2020-10-13 12:26:51 INFO BrokerControllerScheduledThread1 - Slave fall behind master: 0 bytes
2020-10-13 12:26:53 INFO brokerOutApi_thread_4 - register broker[0]to name server 47.101.167.214:9876 OK
2020-10-13 12:27:23 INFO brokerOutApi_thread_1 - register broker[0]to name server 47.101.167.214:9876 OK
2020-10-13 12:27:51 INFO BrokerControllerScheduledThread1 - dispatch behind commit log 0 bytes
2020-10-13 12:27:51 INFO BrokerControllerScheduledThread1 - Slave fall behind master: 0 bytes
2020-10-13 12:27:53 INFO brokerOutApi_thread_2 - register broker[0]to name server 47.101.167.214:9876 OK
2020-10-13 12:28:23 INFO brokerOutApi_thread_3 - register broker[0]to name server 47.101.167.214:9876 OK
2020-10-13 12:28:51 INFO BrokerControllerScheduledThread1 - dispatch behind commit log 0 bytes
2020-10-13 12:28:51 INFO BrokerControllerScheduledThread1 - Slave fall behind master: 0 bytes
2020-10-13 12:28:53 INFO brokerOutApi_thread_4 - register broker[0]to name server 47.101.167.214:9876 OK
org.springframework.messaging.MessagingException: sendDefaultImpl call timeout; nested exception is org.apache.rocketmq.remoting.exception.RemotingTooMuchRequestException: sendDefaultImpl call timeout
at org.apache.rocketmq.spring.core.RocketMQTemplate.syncSend(RocketMQTemplate.java:194)
at org.apache.rocketmq.spring.core.RocketMQTemplate.syncSend(RocketMQTemplate.java:126)
at org.apache.rocketmq.spring.core.RocketMQTemplate.syncSend(RocketMQTemplate.java:114)
at org.apache.rocketmq.spring.core.RocketMQTemplate.doSend(RocketMQTemplate.java:514)
at org.apache.rocketmq.spring.core.RocketMQTemplate.doSend(RocketMQTemplate.java:53)
at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:109)
at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:151)
at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:129)
at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:122)
at com.rocket.pro.rocketpro.RocketProApplicationTests.contextLoads(RocketProApplicationTests.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
Caused by: org.apache.rocketmq.remoting.exception.RemotingTooMuchRequestException: sendDefaultImpl call timeout
at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendDefaultImpl(DefaultMQProducerImpl.java:640)
at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:1310)
at org.apache.rocketmq.client.producer.DefaultMQProducer.send(DefaultMQProducer.java:358)
at org.apache.rocketmq.spring.core.RocketMQTemplate.syncSend(RocketMQTemplate.java:188)
... 39 more
3回答
-
经过线下沟通,发现问题存在,能复现。
部署环境:
RocketMQ在阿里云服务器
测试代码在本机,代码如下:
@Autowired private RocketMQTemplate rocketMQTemplate; @Test public void contextLoads() { Map<String,Object>map=new HashMap<>(); map.put("name","jack"); map.put("age","20"); rocketMQTemplate.convertAndSend("test-rocket-info",map); }
解决方案:
修改broker.conf,内容如下:
brokerClusterName = DefaultCluster brokerName = broker-a brokerId = 0 deleteWhen = 04 fileReservedTime = 48 brokerRole = ASYNC_MASTER flushDiskType = ASYNC_FLUSH namesrvAddr=47.101.167.214:9876 listenPort=10911 brokerIP1=47.101.167.214
这里的47.101.167.214是公网IP
2. 启动Name Server:
nohup sh bin/mqnamesrv &
3. 启动Broker:
nohup sh bin/mqbroker -n 47.101.167.214:9876 -c conf/broker.conf &
=======
定位问题的过程:
在GitHub上找到了相同问题: https://github.com/apache/rocketmq/issues/568 ,里面说要么设置setVipChannelEnabled,要么开放10911、10909这两个端口。
而测试代码使用的是RocketMQTemplate玩的,无法直接操作setVipChannelEnabled,所以不妨顺着第二条路走(开放10911、10909这两个端口)
然而,我发现在本机telnet 10911、10909这两个端口是通的,说明端口开放没问题。
====
陷入僵局后,我就分析nohup日志,发现有类似如下的日志:
The broker[iZuf6h6yzsw5uybsq1y7w8Z, 172.19.172.31:10911] boot success. serializeType=JSON and name server is 47.101.167.214:9876
也就是说,broker启动时,往Name Server注册的是个内网地址(172.19.172.31),而我们希望是公网地址。所以,修改下broker.conf,设置下IP;并在启动broker时,用-c conf/broker.conf 指定读取配置文件。
此时,会打印类似如下的日志,和预期相符。
The broker[broker-a, 47.101.167.214:10911] boot success. serializeType=JSON and name server is 47.101.167.214:9876
=====
注意点:
需要开放10911、10909这两个端口
需修改broker.conf,设置公网IP
启动broker时,需用-c conf/broker.conf,读取配置文件
112020-10-13 -
大目
2020-10-13
经过私聊,提供了机器环境与测试代码,问题能复现。
部署环境:
RocketMQ部署在阿里云机器上,端口已开放
测试代码在本机,代码如下
@Autowired private RocketMQTemplate rocketMQTemplate; @Test public void contextLoads() { Map<String,Object>map=new HashMap<>(); map.put("name","jack"); map.put("age","20"); rocketMQTemplate.convertAndSend("test-rocket-info",map); }
解决方案:
修改broker.conf,绑定外网IP,例如:
brokerClusterName = DefaultCluster brokerName = broker-a brokerId = 0 deleteWhen = 04 fileReservedTime = 48 brokerRole = ASYNC_MASTER flushDiskType = ASYNC_FLUSH namesrvAddr=47.101.167.214:9876 listenPort=10911 brokerIP1=47.101.167.214
2. 启动Name Server
nohup sh bin/mqnamesrv &
3. 启动Broker
nohup sh bin/mqbroker -n 47.101.167.214:9876 -c conf/broker.conf &
=============
定位过程:
在GitHub上有童鞋遇到了相同问题:https://github.com/apache/rocketmq/issues/568 ,说是端口开放问题(10911、10909),说要么开放这俩端口,要么设置setVipChannelEnabled(false);
然而:
在本机telnet这两个端口,都是通的
看了下代码,setVipChannelEnabled(false);这行代码在由org.apache.rocketmq.spring.core.RocketMQTemplate#createTransactionMQProducer调用的,只能设置RPCHook去控制(对应配置中的rocketmq.producer.access-key/secret-key,而这俩配置有其他作用,故而此路不通)
所以应该还是沿着第一条路走。我看到nohup日志中
The broker[iZuf6h6yzsw5uybsq1y7w8Z, 172.19.172.31:10911] boot success. serializeType=JSON and name server is 47.101.167.214:9876
这个注册的地址和预期不同(应该注册公网IP),所以应该修改broker.con文件,并在启动broker时应该加个-c conf/broker.conf 指定读取配置文件。
=============
写在最后:
注意点:
需要开放9876、10911、10909三个端口
需要修改broker.conf文件,修改成公网IP
启动broker时,需要用-c broker.conf文件,指定使用的配置文件。
00 -
大目
2020-10-13
您好,说实话我没能从你6个帖子中的贴出的日志找到问题,而且你的日志太混乱了,一会是172的IP启动,一会是47.101.167.214这个IP
不过,从
org.springframework.messaging.MessagingException: sendDefaultImpl call timeout; nested exception is org.apache.rocketmq.remoting.exception.RemotingTooMuchRequestException: sendDefaultImpl call timeout
以及类似如下的日志:
2020-10-13 12:23:42 INFO brokerOutApi_thread_1 - register broker[0]to name server 172.19.172.31:9876 OK
来看,你启动RocketMQ使用的是个内网地址。
=====
如果你的RocketMQ和你的应用(MQ的消费者)不在同意局域网内,需要绑定外网IP的。
你试试这样玩:
1. conf/broker.conf 添加如下内容:
namesrvAddr=你的外网IP:9876 brokerIP1=你broker的外网IP
2. 启动时,
nohup sh bin/mqnamesrv & nohup sh bin/mqbroker -n 外网IP:9876 -c conf/broker.conf &
或者,你不知道怎么配置的话,就统一搞成你应用连接RocketMQ时候所用的IP吧。
===========
以上是我凭经验的作答,不一定有效。还是希望您能提供:
你的网络拓扑是怎样的?应用所在机器的IP是多少、RocketMQ所在的机器IP是多少、彼此之间的网络拓扑关系。
部署环境是怎样的?例如,是不是在云环境(比如阿里云上,还得额外配置安全组,开放端口)
复现过程,也就是你第一步做了什么,第二步做了什么,然后发生的完整异常是什么。
=======
最后,一个问题只需要发一个帖子就OK啦。祝您学习愉快 !
012020-10-13
相似问题