Eureka application配置文件
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>