I am currently facing a problem where Eureka does not unregister a registered service. I pulled the Eureka server example directly from the git hub and made only one change, eureka.enableSelfPreservation = false . My application.yml application is as follows:
server: port: 8761 eureka: enableSelfPreservation: false client: registerWithEureka: false fetchRegistry: false server: waitTimeInMsWhenSyncEmpty: 0
I read that if 85% of registered services stop delivering heart rate within 15 minutes, Eureka suggests that the problem is with the network and will not unregister services that do not respond. In my case, only one service works for me, so I turned off the self-preservation mode. I suddenly kill the process and Eureka leaves the service registered for what seems like an indefinite amount of time.
My application.yml client looks like this:
eureka: instance: leaseRenewalIntervalInSeconds: 3 client: healthcheck: enabled: true serviceUrl: defaultZone: http://localhost:8761/eureka/ appInfo: replicate: interval: 3 initial: replicate: time: 3 spring: rabbitmq: addresses: ${vcap.services.${PREFIX:}rabbitmq.credentials.uri:amqp://${RABBITMQ_HOST:localhost}:${RABBITMQ_PORT:5672}}
My goal is to create a demo in which Eureka quickly discovers that the service is no longer working and another running service can quickly register itself.
At the moment, as soon as the eureka client is launched, it registers after 3 seconds. He just never cancels the registration when the service suddenly stops. After I kill the service, the Eureka dashboard reads:
EMERGENCY! EUREKA MAY BE WRONG CLAIMS WHEN THEY ARE NOT. UPDATES - LESS THAN THRESHOLD AND HERITAGE INSTANTS DO NOT LONG ONLY FOR SECURITY.
How can I prevent this behavior?
spring-cloud netflix-eureka
lp1776 Sep 16 '15 at 18:43 2015-09-16 18:43
source share