nacos以mysql为数据源进行持久化,报“No DataSource set”错误
条评论本机docker环境启动nacos,nacos以mysql为数据源进行持久化
1 | docker run -d --name nacos -p 8848:8848 -p 9848:9848 -p 9849:9849 --restart=always -e JVM_XMS=256m -e JVM_XMX=256m -e MODE=standalone -e SPRING_DATASOURCE_PLATFORM=mysql -e MYSQL_SERVICE_HOST=192.168.1.123 -e MYSQL_SERVICE_PORT=3306 -e MYSQL_SERVICE_DB_NAME=ry-config -e MYSQL_SERVICE_USER=root -e MYSQL_SERVICE_PASSWORD=mysql2017 -e MYSQL_SERVICE_DB_PARAM="characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC" nacos/nacos-server |
启动时报错:
1 | org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'memoryMonitor' defined in URL [jar:file:/home/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-config-2.1.0.jar!/com/alibaba/nacos/config/server/monitor/MemoryMonitor.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'asyncNotifyService': Unsatisfied dependency expressed through field 'dumpService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'externalDumpService': Invocation of init method failed; nested exception is ErrCode:500, ErrMsg:Nacos Server did not start because dumpservice bean construction failure : |
查看nacos.log 报错
1 | Caused by: com.mysql.cj.exceptions.CJException: Access denied for user 'root'@'192.168.1.123' (using password: YES) |
问题解决
all privileges on . to root@’%’ identified by ‘123456’ with grant option;
本文标题:nacos以mysql为数据源进行持久化,报“No DataSource set”错误
文章作者:fantasykai
发布时间:2022-08-09
最后更新:2025-02-11
原始链接:http://ai.mak.cn/posts/46033/
版权声明:本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明出处!