版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/lovelovelovelovelo/article/details/86762426
配置中心作为Eureka client注册到Eureka server
使用注解
@SpringBootApplication
@EnableDiscoveryClient
@EnableConfigServer
或者使用注解
@EnableConfigServer
@SpringCloudApplication
使用classpath下配置文件配置:
server:
port: 8888
spring:
application:
name: @artifactId@
profiles:
active: native
cloud:
config:
server:
native:
search-locations: classpath:/config/
eureka:
instance:
prefer-ip-address: true
client:
service-url:
defaultZone: http://xxx:yyy@eureka:8761/eureka/
使用git上配置文件