docker-compose 部署rocketMq后创建topic出错

tech2023-10-19  89

rocketmq中文介绍及简单示例

docker-compose 部署 rocketmq

发送消息时出现错误

MQClientException: No route info of this topic, TopicTest

进入docker容器,docker exec -it rmqnamesrv /bin/sh查看具体日志:./mqadmin topicRoute -n localhost:9876 -t TopicTest org.apache.rocketmq.tools.command.SubCommandException: TopicRouteSubCommand command failed at org.apache.rocketmq.tools.command.topic.TopicRouteSubCommand.execute(TopicRouteSubCommand.java:64) at org.apache.rocketmq.tools.command.MQAdminStartup.main0(MQAdminStartup.java:138) at org.apache.rocketmq.tools.command.MQAdminStartup.main(MQAdminStartup.java:89) Caused by: org.apache.rocketmq.acl.common.AclException: [10015:signature-failed] unable to calculate a request signature. error=[10015:signature-failed] unable to calculate a request signature. error=Algorithm HmacSHA1 not available at org.apache.rocketmq.acl.common.AclSigner.signAndBase64Encode(AclSigner.java:84) at org.apache.rocketmq.acl.common.AclSigner.calSignature(AclSigner.java:73) at org.apache.rocketmq.acl.common.AclSigner.calSignature(AclSigner.java:68) at org.apache.rocketmq.acl.common.AclUtils.calSignature(AclUtils.java:68) at org.apache.rocketmq.acl.common.AclClientRPCHook.doBeforeRequest(AclClientRPCHook.java:44) at org.apache.rocketmq.remoting.netty.NettyRemotingAbstract.doBeforeRpcHooks(NettyRemotingAbstract.java:172) at org.apache.rocketmq.remoting.netty.NettyRemotingClient.invokeSync(NettyRemotingClient.java:370) at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1331) at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1321) at org.apache.rocketmq.tools.admin.DefaultMQAdminExtImpl.examineTopicRouteInfo(DefaultMQAdminExtImpl.java:305) at org.apache.rocketmq.tools.admin.DefaultMQAdminExt.examineTopicRouteInfo(DefaultMQAdminExt.java:251) at org.apache.rocketmq.tools.command.topic.TopicRouteSubCommand.execute(TopicRouteSubCommand.java:60) ... 2 more Caused by: org.apache.rocketmq.acl.common.AclException: [10015:signature-failed] unable to calculate a request signature. error=Algorithm HmacSHA1 not available at org.apache.rocketmq.acl.common.AclSigner.sign(AclSigner.java:63) at org.apache.rocketmq.acl.common.AclSigner.signAndBase64Encode(AclSigner.java:79) ... 13 more Caused by: java.security.NoSuchAlgorithmException: Algorithm HmacSHA1 not available at javax.crypto.Mac.getInstance(Mac.java:181) at org.apache.rocketmq.acl.common.AclSigner.sign(AclSigner.java:57) ... 14 more 查找/jre/lib/ext jar包路径:find / -name ‘ext’ |grep jdk find: '/proc/tty/driver': Permission denied find: '/root': Permission denied find: '/run/cryptsetup': Permission denied /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/bin/extcheck /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/jre/lib/ext /usr/lib/jvm-exports/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/jdbc-stdext-1.8.0.222.b10.jar /usr/lib/jvm-exports/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/jdbc-stdext-1.8.0.jar /usr/lib/jvm-exports/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/jdbc-stdext-3.0.jar /usr/lib/jvm-exports/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/jdbc-stdext.jar 修改tools.sh: vi tools.sh (-Djava.ext.dirs 值后面添加XX/XX/jre/lib/ext全路径) #=========================================================================================== # JVM Configuration #=========================================================================================== JAVA_OPT="${JAVA_OPT} -server -Xms1g -Xmx1g -Xmn256m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=128m" JAVA_OPT="${JAVA_OPT} -Djava.ext.dirs=${BASE_DIR}/lib:${JAVA_HOME}/jre/lib/ext:${JAVA_HOME}/lib/ext:${JAVA_HOME}/lib/ext:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/jre/lib/ext" JAVA_OPT="${JAVA_OPT} -cp ${CLASSPATH}" $JAVA ${JAVA_OPT} $@ 再次查看日志信息:mqadmin topicRoute -n localhost:9876 -t TopicTest RocketMQLog:WARN No appenders could be found for logger (io.netty.util.internal.PlatformDependent0). RocketMQLog:WARN Please initialize the logger system properly. { "brokerDatas":[ { "brokerAddrs":{0:"172.22.0.4:10911" }, "brokerName":"broker-a", "cluster":"DefaultCluster" } ], "filterServerTable":{}, "queueDatas":[ { "brokerName":"broker-a", "perm":6, "readQueueNums":16, "topicSynFlag":0, "writeQueueNums":16 } ] }
最新回复(0)