栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

解决异常: Nacos Server did not start because dumpservice bean construction failure : No DataSource set

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

解决异常: Nacos Server did not start because dumpservice bean construction failure : No DataSource set

相信很多同学用nacos配置mysql时都遇到了这个报错(No DataSource set)

2022-01-22 10:23:25,063 ERROR Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'memoryMonitor' defined in URL [jar:file:/F:/Environment/nacos-server-2.0.3/target/nacos-server.jar!/BOOT-INF/lib/nacos-config-2.0.3.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 :
No DataSource set

先简单总结一下nacos配置mysql步骤:

    新建数据库nacos_config, 执行sql脚本生成表单在application.properties下配置mysql相关属性启动

一般都是在配置application.properties文件时出了问题, 如果直接照抄官方文档会报错, 因为mysql8.0之后的版本, 需要在官网文档配置mysql的基础上加上mysql时区的设置

正确的配置如下:

spring.datasource.platform=mysql

db.num=1
db.url.0=jdbc:mysql://127.0.0.1:3306/nacos_config?characterEncoding=utf8&serverTimezone=UTC&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
db.user=我的mysql用户名
db.password=我的密码

启动成功!

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/711033.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号