rocketMQ:unable to calculate a request signature. error=Algorithm HmacSHA1 not available

rocketMQ使用 ./mqadmin topicList -n localhost:9876报错

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:135)
	at org.apache.rocketmq.tools.command.MQAdminStartup.main(MQAdminStartup.java:86)
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:58)
	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.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
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)
	... 12 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)
	... 13 more

解决方法:

vim /home/H/rocketmq-all-4.4.0/distribution/target/apache-rocketmq/bin/tools.sh
在${JAVA_HOME}/jre/lib/ext后加上ext文件夹的绝对路径
例如:

JAVA_OPT="${JAVA_OPT} -server -Xms1g -Xmx1g -Xmn256m -XX:PermSize=128m -XX:MaxPermSize=128m"
JAVA_OPT="${JAVA_OPT} -Djava.ext.dirs=${BASE_DIR}/lib:${JAVA_HOME}/jre/lib/ext:/usr/java/jdk1.8.0_65/jre/lib/ext"

你可能感兴趣的:(linux,rocketmq)