diff --git a/rush-config/src/main/resources/config/application.yml b/rush-config/src/main/resources/config/application.yml index 0dd9e46..48f3998 100644 --- a/rush-config/src/main/resources/config/application.yml +++ b/rush-config/src/main/resources/config/application.yml @@ -3,8 +3,14 @@ eureka: client: service-url: defaultZone: ${EUREKA_URL:http://localhost:8761/eureka} + registry-fetch-interval-seconds: 5 + healthcheck: + enabled: true instance: prefer-ip-address: true + instance-id: ${spring.application.name}:${random.uuid} + lease-renewal-interval-in-seconds: 10 + lease-expiration-duration-in-seconds: 30 management: endpoints: diff --git a/rush-eureka/README.md b/rush-eureka/README.md index 341c2db..343e896 100644 --- a/rush-eureka/README.md +++ b/rush-eureka/README.md @@ -4,6 +4,10 @@ Eureka 서비스 레지스트리. Spring 서비스들이 여기에 등록되고, 대시보드: http://localhost:8761 +- 서비스는 10초마다 하트비트를 보내고, 30초 동안 없으면 5초 주기 정리 작업에서 빠집니다. +- 서비스가 정상 종료하면 바로 등록이 해제됩니다. 응답 없이 죽으면 하트비트 만료와 게이트웨이 목록 갱신(5초)·캐시(5초)를 거쳐 1분 안에 라우팅에서 빠집니다. +- 자기 보존 모드는 로컬에서 꺼 둡니다. 운영에서는 `EUREKA_SELF_PRESERVATION=true`로 켭니다. + ## 실행 ```bash diff --git a/rush-eureka/src/main/resources/application.yml b/rush-eureka/src/main/resources/application.yml index 2ac2960..1a68ab0 100644 --- a/rush-eureka/src/main/resources/application.yml +++ b/rush-eureka/src/main/resources/application.yml @@ -11,7 +11,10 @@ eureka: register-with-eureka: false fetch-registry: false server: - enable-self-preservation: false + enable-self-preservation: ${EUREKA_SELF_PRESERVATION:false} + eviction-interval-timer-in-ms: 5000 + response-cache-update-interval-ms: 5000 + wait-time-in-ms-when-sync-empty: 0 management: endpoints: diff --git a/rush-gateway/src/main/resources/application.yml b/rush-gateway/src/main/resources/application.yml index e88a912..66951c8 100644 --- a/rush-gateway/src/main/resources/application.yml +++ b/rush-gateway/src/main/resources/application.yml @@ -7,6 +7,9 @@ spring: config: import: optional:configserver:${CONFIG_URL:http://localhost:8888} cloud: + loadbalancer: + cache: + ttl: 5s gateway: server: webflux: