Loading

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>
posted @ 2023-09-04 16:13  星流残阳  阅读(40)  评论(0编辑  收藏  举报