RocketMQ connect to failed

问题如下: 执行管理命令时报错

[faedev02@localhost bin]$ ./mqadmin topicList
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
org.apache.rocketmq.tools.command.SubCommandException: TopicListSubCommand command failed
        at org.apache.rocketmq.tools.command.topic.TopicListSubCommand.execute(TopicListSubCommand.java:113)
        at org.apache.rocketmq.tools.command.MQAdminStartup.main0(MQAdminStartup.java:132)
        at org.apache.rocketmq.tools.command.MQAdminStartup.main(MQAdminStartup.java:83)
Caused by: org.apache.rocketmq.remoting.exception.RemotingConnectException: connect to  failed
        at org.apache.rocketmq.remoting.netty.NettyRemotingClient.invokeSync(NettyRemotingClient.java:393)
        at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicListFromNameServer(MQClientAPIImpl.java:1239)
        at org.apache.rocketmq.tools.admin.DefaultMQAdminExtImpl.fetchAllTopicList(DefaultMQAdminExtImpl.java:222)
        at org.apache.rocketmq.tools.admin.DefaultMQAdminExt.fetchAllTopicList(DefaultMQAdminExt.java:189)
        at org.apache.rocketmq.tools.command.topic.TopicListSubCommand.execute(TopicListSubCommand.java:107)
        ... 2 more

原因是命令少了参数,

通过mqadmin help topicList可看到缺什么参数,把nameserver的地址加上就OK了

[dev02@localhost bin]$ ./mqadmin topicList -n localhost:9876
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
RMQ_SYS_TRANS_HALF_TOPIC
BenchmarkTest
OFFSET_MOVED_EVENT
TBW102
TopicTest1234
localhost.localdomain
SELF_TEST_TOPIC
DefaultCluster

另一方面,rocketmq也应该给个更友好的提示。

你可能感兴趣的:(MQ)