**
nacos2.x 集群启动报错问题
**
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authConfigs': Invocation of init method failed; nested exception is ErrCode:50002, ErrMsg:Empty identity, Please set `nacos.core.auth.server.identity.key` and `nacos.core.auth.server.identity.value`, detail: https://nacos.io/zh-cn/docs/v2/guide/user/auth.html
解决方案:
1、打开 …/nacos-server-2.2.2\nacos\conf\application.properties
修改以下 3 项( nacos2.x 版本,如:nacos-2.2.2 )
## 1)修改前# db.pool.config.minimumIdle=2## 1)修改后,此项非必要,但最好修改一下db.pool.config.minimumIdle=4## 2)修改前# nacos.core.auth.enabled=false## 2)修改后:开启鉴权nacos.core.auth.enabled=true## 3)修改前# nacos.core.auth.server.identity.key=# nacos.core.auth.server.identity.value=## 3)修改后 : 配置自定义身份识别的 key 和 value (不可为空)nacos.core.auth.server.identity.key=nacosnacos.core.auth.server.identity.value=nacos
2、 有可能是端口冲突问题,修改端口号,我修改了两次端口号( 8852 --> 8850 --> 8855 )
3、堆内存问题,打开 …/nacos/bin/startup.cmd
修改以下项( nacos2.x 版本,如:nacos-2.2.2 )
把 set "NACOS_JVM_OPTS=-server -Xms2g -Xmx2g -Xmn1g
更改为 set "NACOS_JVM_OPTS=-server -Xms512m -Xmx512m -Xmn256m如:rem if nacos startup mode is cluster
if %MODE% == "cluster" (echo "nacos is starting with cluster"if %EMBEDDED_STORAGE% == "embedded" (set "NACOS_OPTS=-DembeddedStorage=true")set "NACOS_JVM_OPTS=-server -Xms512m -Xmx512m -Xmn256m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%BASE_DIR%\logs\java_heapdump.hprof -XX:-UseLargePages"
)
4、修改后,重新启动 nacos2.x