创建Spring Config工程
1、初始化工程 https://start.spring.io/ 选config server Eureka Discovery 2、导入IDE改改 入口类上加@EnableConfigServer @EnableDiscoveryClient application.yml server: port: 1027 spring: application: name: vishnu-config cloud: config: server: git: uri: https://gitee.com/frankawp/vishnu-config eureka: instance: prefer-ip-address: true lease-renewal-interval-in-seconds: 5 lease-expiration-duration-in-seconds: 20 client: serviceUrl: defaultZone: http://localhost:1026/eureka registry-fetch-interval-seconds: 10 把配置文件传到这个git上。 vishnu-userinfo-dev.yml 启动后在 localhost:1027/vishnu-userinfo/dev 上可以看到这个配置文件就对了 先启动eureka