大目老师你好,请问nacos怎么配置druid呢?我配置了启动报错

来源:12-5 引导上下文

寂兮寥兮

2019-12-27

Located property source: CompositePropertySource {name='NACOS', propertySources=[NacosPropertySource {name='user-dev.yaml'}, NacosPropertySource {name='user.yaml'}, NacosPropertySource {name='user'}]}


Description:


Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.


Reason: Failed to determine a suitable driver class



Action:


Consider the following:

If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.

If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).



Process finished with exit code 1



写回答

1回答

大目

2019-12-27

一样的哈。步骤:

  1. 首先在本地的application.yml配置Druid,确保配置成功;

  2. 建立dataId = user.yaml的数据(NacosPropertySource {name='user.yaml'},我是通过你日志的这一段看出来的

  3. 把你原先配置在本地的、Druid相关的配置,挪到Nacos里的user.yaml这条数据中。

0
4
寂兮寥兮
回复
大目
好吧,谢谢
2019-12-30
共4条回复

Spring Cloud Alibaba微服务从入门到进阶

面向未来微服务:熟练掌握Spring Cloud Alibaba

3085 学习 · 1324 问题

查看课程