Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.2.3 部署nacos集群是否不能设置为embedded存储模式 #395

Open
billyyoyo opened this issue Mar 8, 2024 · 3 comments
Open

2.2.3 部署nacos集群是否不能设置为embedded存储模式 #395

billyyoyo opened this issue Mar 8, 2024 · 3 comments

Comments

@billyyoyo
Copy link

部署nacos集群是否不能设置为embedded存储模式,用mysql一切正常

根据nacose-ip.yml修改:
#nacos dev env
NACOS_SERVERS=172.16.238.10:8848 172.16.238.11:8848 172.16.238.12:8848
NACOS_AUTH_ENABLE=true
EMBEDDED_STORAGE=embedded
#SPRING_DATASOURCE_PLATFORM=mysql
#MYSQL_SERVICE_HOST=172.100.0.1
#MYSQL_SERVICE_DB_NAME=nacos
#MYSQL_SERVICE_PORT=3306
#MYSQL_SERVICE_USER=xxxx
#MYSQL_SERVICE_PASSWORD=xxxx
#MYSQL_SERVICE_DB_PARAM=characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
NACOS_AUTH_IDENTITY_KEY=2222
NACOS_AUTH_IDENTITY_VALUE=2xxx
NACOS_AUTH_TOKEN=SecretKey012345678901234567890123456789012345678901234567890123456789

nacos.log
Caused by: com.alibaba.nacos.api.exception.runtime.NacosRuntimeException: errCode: 500, errMsg: java.lang.NullPointerException
at com.alibaba.nacos.config.server.service.repository.embedded.DistributedDatabaseOperateImpl.queryOne(DistributedDatabaseOperateImpl.java:237)

protocol-raft.log
2024-03-08 16:41:15,515 ERROR Failed to join the cluster, retry...
java.lang.IllegalStateException: Fail to get leader of group nacos_config, Unknown leader, Unknown leader, Unknown leader
at com.alipay.sofa.jraft.core.CliServiceImpl.getPeers(CliServiceImpl.java:605)

@ghost
Copy link

ghost commented Mar 19, 2024

有同样的疑问:

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:165)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292)
        at com.alibaba.nacos.Nacos.main(Nacos.java:48)
...
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'basicAuthenticationFilter' defined in class path resource [com/alibaba/nacos/prometheus/filter/PrometheusAuthFilter.class]: Unsatisfied dependency expressed through method 'basicAuthenticationFilter' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nacosAuthConfig' defined in URL [jar:file:/home/nacos/target/nacos-server.jar!/BOOT-INF/lib/default-auth-plugin-2.3.0.jar!/com/alibaba/nacos/plugin/auth/impl/NacosAuthConfig.class]: Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nacosUserDetailsServiceImpl': Unsatisfied dependency expressed through field 'userPersistService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'externalUserPersistServiceImpl': Invocation of init method failed; nested exception is java.lang.RuntimeException: java.lang.RuntimeException: [db-load-error]load jdbc.properties error

@secbr
Copy link

secbr commented May 17, 2024

部署nacos集群是否不能设置为embedded存储模式,用mysql一切正常

根据nacose-ip.yml修改: #nacos dev env NACOS_SERVERS=172.16.238.10:8848 172.16.238.11:8848 172.16.238.12:8848 NACOS_AUTH_ENABLE=true EMBEDDED_STORAGE=embedded #SPRING_DATASOURCE_PLATFORM=mysql #MYSQL_SERVICE_HOST=172.100.0.1 #MYSQL_SERVICE_DB_NAME=nacos #MYSQL_SERVICE_PORT=3306 #MYSQL_SERVICE_USER=xxxx #MYSQL_SERVICE_PASSWORD=xxxx #MYSQL_SERVICE_DB_PARAM=characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true NACOS_AUTH_IDENTITY_KEY=2222 NACOS_AUTH_IDENTITY_VALUE=2xxx NACOS_AUTH_TOKEN=SecretKey012345678901234567890123456789012345678901234567890123456789

nacos.log Caused by: com.alibaba.nacos.api.exception.runtime.NacosRuntimeException: errCode: 500, errMsg: java.lang.NullPointerException at com.alibaba.nacos.config.server.service.repository.embedded.DistributedDatabaseOperateImpl.queryOne(DistributedDatabaseOperateImpl.java:237)

protocol-raft.log 2024-03-08 16:41:15,515 ERROR Failed to join the cluster, retry... java.lang.IllegalStateException: Fail to get leader of group nacos_config, Unknown leader, Unknown leader, Unknown leader at com.alipay.sofa.jraft.core.CliServiceImpl.getPeers(CliServiceImpl.java:605)

实测通过embedded存储模式可以实现集群的功能,注意基于内嵌数据库存在的启动命令为:
sh startup.sh -p embedded,其中参数是-p而不是-m

@secbr
Copy link

secbr commented May 17, 2024

有同样的疑问:

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:165)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292)
        at com.alibaba.nacos.Nacos.main(Nacos.java:48)
...
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'basicAuthenticationFilter' defined in class path resource [com/alibaba/nacos/prometheus/filter/PrometheusAuthFilter.class]: Unsatisfied dependency expressed through method 'basicAuthenticationFilter' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nacosAuthConfig' defined in URL [jar:file:/home/nacos/target/nacos-server.jar!/BOOT-INF/lib/default-auth-plugin-2.3.0.jar!/com/alibaba/nacos/plugin/auth/impl/NacosAuthConfig.class]: Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nacosUserDetailsServiceImpl': Unsatisfied dependency expressed through field 'userPersistService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'externalUserPersistServiceImpl': Invocation of init method failed; nested exception is java.lang.RuntimeException: java.lang.RuntimeException: [db-load-error]load jdbc.properties error

实测通过embedded存储模式可以实现集群的功能,注意基于内嵌数据库存在的启动命令为:
sh startup.sh -p embedded,其中参数是-p而不是-m

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants