config 配置中心无法被其他微服务读取配置

1:这是无法启动项目的 配置文件信息: 

spring:
  application:
    name: project
  cloud:
    config:
      discovery:
        enabled: true
        service-id: CONFIG
      profile: dev
eureka:
  client:
    service-url:
      defaultZone: http://localhost:8761/eureka/

统一配置中心 其他服务始终配不上去

2:报错信息:

2019-07-16 15:37:54.701 ERROR 6020 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Cannot determine embedded database driver class for database type NONE

Action:

If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).

3:远端git  配置文件 

导致原因是:在上述文件中,application 应用名配置的是 project ,应该改为远端git 下的配置文件名 product

应用在 eureka 的服务名称为 CONFIG ,profile 配置文件的追加名 dev

原理:会去eureka 先找到名为 CONFIG 的服务 ,然后去 config 的git 仓库查找 project-dev.yml 的文件. 如果找不到,就去找 project.yml 还找不到那么这个项目配置了 database 导致项目都无法启动了

结论:正确的配置文件 -就因为应用名和远端git 下的配置文件不匹配所以导致 mysql 驱动无法连接,从而启动不了项目

spring:
  application:
    name: project
  cloud:
    config:
      discovery:
        enabled: true
        service-id: CONFIG
      profile: dev
eureka:
  client:
    service-url:
      defaultZone: http://localhost:8761/eureka/
原文地址:https://www.cnblogs.com/blogspring/p/14191771.html