Spring-cloud-netflix: Why when shutting services down you can still see them and get their url's

Created on 12 Nov 2018  路  6Comments  路  Source: spring-cloud/spring-cloud-netflix

I am using spring boot 2.1.0

I started two instances of microservice X and i can see them on eureka ui.

When i shut down one of them, i can see it for a long time and the load balancer gives the url of the turned off service 50% of the times..

Can i configure eureka to remove the service after couple of seconds?

question

All 6 comments

Eureka and ribbon both have built-in caches at the server and client. You can certainly change those values, but eureka is built as an eventually consistent store. If you need immediate consistency, another discovery service (such as consul) might be a better choice.

Can i configure eureka to remove the service after couple of seconds?

Hi @VitalyKheifets
So far there is not configure you can set that.For eureka server has a background task which is delete expired instance(default value is 60s).

As far as i know you can reduce this delay through configure, but it won't be done immediately(As mentioned by spencergibb).

Turn off self-protection mechanism
Turn off the eureka server cache mechanism

Thanks

@VitalyKheifets if you want to properly shutdown service while using Eureka you should firstly remove it from Eureka, wait around 60 seconds until it is removed from cache after that you can safely shutdown your service.

By removing from Eureka I mean putting it manually into DOWN or OUT_OF_SERVICE status via REST API.

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

Was this page helpful?
0 / 5 - 0 ratings