记录下配置文件,方便以后直接copy。
server端
server:
port: 13000
spring:
application:
name: test-eureka-server
eureka:
server:
enable-self-preservation: true
renewal-percent-threshold: 0.85
eviction-interval-timer-in-ms: 60000
client:
register-with-eureka: false
fetch-registry: false
instance:
hostname: ${spring.application.name}
client端
server:
servlet:
context-path: /database
port: 13001
eureka:
client:
service-url:
defaultZone: http://localhost:13000/eureka/
spring:
application:
name: database
client的pom.xml需要额外加入:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
标签:配置文件,spring,eureka,application,client,Eureka,server
From: https://www.cnblogs.com/liu-im/p/17677382.html