server:
port: 10080
spring:
application:
name: config
cloud:
config:
server:
git:
uri: http://gitlab:8050/ecms-java/ecms-java-config.git
search-paths: config-repo
username: root
password: 123456
eureka:
instance:
lease-expiration-duration-in-seconds: 15
lease-renewal-interval-in-seconds: 5
client:
registry-fetch-interval-seconds: 5
service-url:
defaultZone: http://ecms-registry:10070/eureka/
#关闭Spring Boot Actuator的健康监控,如果不关闭则会自动连接redis然后报错Redis health check failed
management:
health:
redis:
enabled: false
2020-01-07 10:21:37.305 INFO 4816 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at : http://localhost:8888
原因是application.yml启动优先级小于bootstrap.yml
将application.yml重命名为bootstrap.yml即可