Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring boot eureka - remove dead services

I am researching about Eureka for services discovery and I found out that if I kill a process, eureka displays it as "DOWN". Will it clean it and remove it on it's own someday?

The scenario is this: Lets say I am working with amazon AWS. I want to upload a new version this way: prepare X new machines and kill the old ones.

The new machines will register to eureka on startup, but how will the old machines be unregistered from Eureka?

I use java and spring-cloud.

Thanks, Ido

like image 326
Ido Barash Avatar asked May 09 '26 15:05

Ido Barash


1 Answers

Not sure if this will help you but you can try this.

Eureka server application.yml

eureka:
  server:
    enableSelfPreservation: false

Service application.yml

eureka:
  instance:
    leaseRenewalIntervalInSeconds: 1
    leaseExpirationDurationInSeconds: 2

Read this for info:- https://github.com/ExampleDriven/spring-cloud-eureka-example

like image 106
Grinish Nepal Avatar answered May 12 '26 10:05

Grinish Nepal