首页 > 其他分享 >容器化部署nacos 1.4.6报错caused: The specified key byte array is 0 bits which is not secure enough for any

容器化部署nacos 1.4.6报错caused: The specified key byte array is 0 bits which is not secure enough for any

时间:2023-08-18 13:56:52浏览次数:42  
标签:1.4 secure JWT 端口 nacos enough 报错 key

nacos2.0+ 与nacos 1.x区别

nacos在2.0+版本开始使用grpc与客户端通信,并且通过非8848端口通信
主要是有两个端口

端口 与主端口的偏移量 描述
9848 1000 客户端gRPC请求服务端端口,用于客户端向服务端发起连接和请求
9849 1001 服务端gRPC请求服务端端口,用于服务间同步等

然而,我们的需求是在k8s中部署nacos,并且使用nodeport方式映射端口。
这样就会导致9848端口映射出去的端口,并不是8848端口映射出去的端口+1000。

降低版本至nacos1.4.6

所以降低nacos版本至dockerhub中存在的1.x的最高版本1.4.6
但是部署时又发现问题,使用默认debry数据库启动时,使用账号nacos/nacos登录报错,同时报错十分莫名其妙

caused: The specified key byte array is 0 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).Consider using the io.jsonwebtoken.security.Keys #secretKeyFor(SignatureAlgorithm)method to create a key guaranteed to be secure enough for your preferred HMAC-SHA algorithm.See https: //tools.ietf.org/html/rfc7518#section-3.2 for more information.;

查了半天换了好几个镜像也没整明白,最后发现有一个文章中提到了nacos.core.auth.default.token.secret.key。 这个参数必须配置为base64编码而且不能小于32位,咱也不知道咋回事总之先试试,就随便整个值配上了,结果还真好啦
真是奇葩啊,为啥要搞个莫名其妙的参数,和启动访问又没有关系,服啦

docker部署demo命令

docker run -d --name=nacos -p 8848:8848 -e MODE=standalone -e NACOS_AUTH_TOKEN= SecretKey012345678901234567890123456789012345678901234567890123456789 nacos/nacos-server:v1.4.6-slim

标签:1.4,secure,JWT,端口,nacos,enough,报错,key
From: https://www.cnblogs.com/yechen2019/p/17640267.html

相关文章

  • 解决小程序报错 getLocation:fail the api need to be declared in the requiredPriva
    一、unipp项目打开uniapp项目的配置文件manifest.json,选择“源码视图”。/*小程序特有相关*/"mp-weixin":{"appid":"你的开发者id","setting":{"urlCheck":true,"es6":true,"postcss":......
  • nginx报错: nginx: [error] open() "/opt/nginx/nginx.pid" failed (2: No such file
    出现故障的原因:nginx:[error]open()"/opt/nginx/nginx.pid"failed(2:Nosuchfileordirectory)   服务器重启后,重新启动nginx报错nginx.pid这个文件找不到了!       因为每次重新启动系统,nginx.pid被自动删除。解决方案:    重新生......
  • springboot 打包 时报错:The specified user settings file does not exist: F:\opt\
     解决方法:  ......
  • 1.4 图表设计入门
    一、图表设计1.新建模板2.插入图表合并一片单元格区域,点击上方工具栏插入图表按钮,插入「柱形图」。3.设计柱形图选中图表,点击右侧属性面板「单元格元素」,可设置图表的各个属性:类型、数据、样式、特效。3.1图表类型选中图表所在单元格,点击右侧「单元格元素>类型」可查......
  • pyinstaller打包报错及解决
    #使用方法-h,--help查看该模块的帮助信息-F,-onefile产生单个的可执行文件-D,--onedir产生一个目录(包含多个文件)作为可执行程序-a,--ascii不包含Unicode字符集支持-d,--debug产生debug版本的可执行文件-w,--windowed,--noconsolc指定程序运行时不显示命令行窗口(仅对Wind......
  • 关于Node.js 构建中遇到node-gyp报错问题的解决方案记录
    项目今天进行版本更新,在走阿里云流水线的时候,出现了Node.js构建过程报错问题,抱歉详情截图如下: 经过反复排查,最终发现是因为阿里云的npm仓库的问题,于是果断更换npm仓库,执行命令如下:npmconfigsetregistryhttps://registry.npm.taobao.org然后重新 npmi--force 进行......
  • 0-报错记录
    [top]一.编译时错误1.user\led.c(6):error:#144:avalueoftype"unsignedchar"cannotbeusedtoinitializeanentityoftype"GPIO_InitTypeDef":xx类型不能初始化xx结构体类型这个是由于初始化结构体是将{}写成();......
  • 模拟集成电路设计系列博客——1.1.4 Wilson电流镜
    1.1.4Wilson电流镜另一种高输出阻抗的电流镜是Wilson电流镜,如下图所示:这是一个使用串联-分流反馈来提升输出阻抗的例子,\(Q_2\)获得输出电流将其镜像给\(I_{D1}\),其反过头来与\(I_{in}\)相减。注意\(I_{D1}\)必须精确等于\(I_{in}\),否则\(Q_3\)和\(Q_4\)的栅压将会增加或减少,负......
  • csv reader utf-8报错:strict 改为ignore
    classBufferedIncrementalDecoder(IncrementalDecoder):"""ThissubclassofIncrementalDecodercanbeusedasthebaseclassforanincrementaldecoderifthedecodermustbeabletohandleincompletebytesequences."......
  • scrapy爬取图片报错Missing scheme in request url:
    记录一下scrapy爬取图片遇到的坑目标站点:站长素材图片https://sc.chinaz.com/tupian我的核心源代码#Defineyouritempipelineshere##Don'tforgettoaddyourpipelinetotheITEM_PIPELINESsetting#See:https://docs.scrapy.org/en/latest/topics/item-pipeli......