统一配置管理
1.新建一个模块(config-server)
1.1 添加依赖
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
</dependencies>
1
2
3
4
5
6
7
8
9
10
1.2 添加yml文件
server:
port: 9400
eureka:
client:
serviceUrl:
defaultZone: http://localhost:7001/eureka
instance:
prefer-ip-address: true
spring:
cloud:
config:
server:
git:
uri: #仓库