qingjiuquan 2020-04-23
<dependencies> <!--config服务端--> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-config-server</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies>
server.port=8768 spring.application.name=config-server # 加载本地开发环境 spring.profiles.active=native #申明本地配置文件的存放位置 spring.cloud.config.server.native.searchLocations=classpath:/conf #开启消息跟踪 spring.cloud.bus.trace.enabled=true # 注册中心地址 eureka.client.serviceUrl.defaultZone=http://127.0.0.1:8761/eureka # true将IP注册到Eureka,false将机器的主机名注册到Eureka eureka.instance.prefer-ip-address=true
#指定链接到的config uri链接 spring.cloud.config.uri=http://127.0.0.1:8768 #找不到配置文件执行快速失败 spring.cloud.config.fail-fast=true #配置文件名(前缀) spring.cloud.config.name=dataSource #配置文件名(后缀) spring.cloud.config.profile=dev