docker-compose部署rocketmq 启动后控制台访问,到消费者这边一直报错:[2021-01-18 08:26:01.243] WARN examineConsumerConnectionInfo exception, FILTERSRV_CONSUMER rocketmq-console-ng | org.apache.rocketmq.client.exception.MQClientException: CODE: 17 DESC: No topic route info in name server for the topic: %RETRY%FILTERSRV_CONSUMER rocketmq-console-ng | See http://rocketmq.apache.org/docs/faq/ for further details. 不知道处理哪里 下面是我的yml文件 version: '2' services: namesrv: image: rocketmqinc/rocketmq container_name: rmqnamesrv ports: - 9876:9876 volumes: - /data/rocketmq/logs:/root/logs - /root/rocketmq/store:/root/store - /etc/localtime:/etc/localtime:ro command: sh mqnamesrv broker: image: rocketmqinc/rocketmq container_name: rmqbroker ports: - 10909:10909 - 10911:10911 - 10912:10912 volumes: - /data/rocketmq/logs:/root/logs - /data/rocketmq/store:/root/store - /data/rocketmq/conf/broker.conf:/root/rocketmq/conf/broker.conf - /etc/localtime:/etc/localtime:ro command: sh mqbroker autoCreateTopicEnable=true -n 192.168.1.38:9876 -c ../conf/broker.conf depends_on: - namesrv environment: - JAVA_HOME=/usr/lib/jvm/jre console: image: styletang/rocketmq-console-ng container_name: rocketmq-console-ng ports: - 8080:8080 volumes: - /etc/localtime:/etc/localtime:ro depends_on: - namesrv environment: - JAVA_OPTS= -Dlogging.level.root=info -Drocketmq.namesrv.addr=rmqnamesrv:9876 - Dcom.rocketmq.sendMessageWithVIPChannel=false
java.lang.RuntimeException: org.apache.rocketmq.remoting.exception.RemotingConnectException: connect to failed at com.google.common.base.Throwables.propagate(Throwables.java:160) at org.apache.rocketmq.console.task.DashboardCollectTask.collectTopic(DashboardCollectTask.java:156) at org.apache.rocketmq.console.task.DashboardCollectTask FastClassBySpringCGLIB c818b8cd.invoke( ) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:721) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85) at org.apache.rocketmq.console.aspect.admin.MQAdminAspect.aroundMQAdminMethod(MQAdminAspect.java:63) 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)
目前我用的rocketmq-console的版本是1.0.1 按理说我在application.properties中配置了
rocketmq.config.namesrvAddr=localhost:9876 并且他的默认值就是localhost:9876,不应该报错connect to ,网上的大部分解决方案都是网络原因,打开防火墙就可以了,但是我的rocketmq与控制台都部署在同一个电脑上不应该出现防火墙问题,后来我尝试在启动脚本后加上namesrv的配置,问题解决了启动脚本如下:
java -jar rocketmq-console-ng-1.0.1.jar --rocketmq.config.namesrvAddr=localhost:9876
问题完美解决,如果您想用idea直接启动,可以在启动配置中加如下配置:
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。