报错原因
Caused by: java.lang.IllegalArgumentException:
the length of secret key must great than or equal 32 bytes;
And the secret key must be encoded by base64.
Please see http://xxx....
Caused by: java.lang.IllegalArgumentException:
The specified key byte array is x bits which is not secure enough for any JWT HMAC-SHA algorithm.
The JWT JWA Specification (RFC 7518, Section 3.2) states that keys used with HMAC-SHA algorithms MUST have a size >= 256 bits (the key size must be greater than or equal to the hash output size).
原因总结
很明显,报错原因是secret key参数 长度不够
打开nacos文件夹 -> conf -> application.properties
找到以下配置:
nacos.core.auth.plugin.nacos.token.secret.key=
在后面添加随机参数作为nacos的加密密钥,
规则是加密密钥长度 >=256 bits 或者 >= 32 bytes
我添加了50位英文、数字成功运行文章来源:https://www.toymoban.com/news/detail-515576.html
执行
startup.cmd -m standalone
最终结果
成功点亮
文章来源地址https://www.toymoban.com/news/detail-515576.html
到了这里,关于解决Nacos2.2.1启动报错的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!