Netflix Eureka Server Replication Status

347 views
Skip to first unread message

prasenjit majumder

unread,
Jul 27, 2015, 6:14:15 AM7/27/15
to eureka_netflix
I am running Eureka Server 1 in Machine 1, and Eureka server 2 in machine 2. I have one Service Instace 1 registered in Eureka Server 2, after registering the service instance is showing in the two Eureka server (as replication happens). Now I have registered Service Instance 2 in Eureka Server 1. And its also showing in the Two Eureka server. So currently in two Eureka server (1 & 2) Service instance (1 & 2) is showing as expected. But when i shutdown eureka server 2 first, and after that shutdown Service instane 1(as it directly registers in Eureka Server 2) it still shows the Two service instances registered in Eureka Server 1. But as currently no instance of Service instance 1 is alive it should not be shown in the Eureka Server 1. 

Please Currect me if i am wrong.

dl...@netflix.com

unread,
Jul 27, 2015, 12:12:08 PM7/27/15
to eureka_netflix, maj12.p...@gmail.com
Hi Prasenjit,

Eureka has a concept of self preservation when if it detects > 20% of the registry is pending eviction (as can happen in your case when your service 2 is not executing a graceful unregister), then it does not execute these evictions. Can you try with the following server-side property setting eureka.enableSelfPreservation=false and see if it addresses your problem?

Thanks

prasenjit majumder

unread,
Jul 29, 2015, 8:25:01 AM7/29/15
to eureka_netflix, dl...@netflix.com
Hi,

The solution that you have provided works fine, thanks.

But by default self preservation mode is True, is there any other configuration available by which we can specify the timespan, outside which the Eureka Registry does the eviction if the service is unreachable.

dl...@netflix.com

unread,
Jul 29, 2015, 7:09:49 PM7/29/15
to eureka_netflix, maj12.p...@gmail.com
Hi Prasenjit,

Self preservation and eviction due to unclean shutdown are two different albeit related concepts. By default eureka server does evict services that uncleanly shutdown (and as such is unreachable but did not gracefully unregister itself with the eureka server). However this default behaviour is suspended when the number of pending evictions for such services reach too high a number. This is a safeguard against large scale network events that may cause temporary outages across a large number of registering services. It just happens that in your example, your registering number of services is 4 (2 eureka server nodes, 2 service nodes), so when one goes away you cross over the default self preservation threshold.

You can lower/change the self preservation threshold with eureka.renewalPercentThreshold=<a double between 0 and 1>.

You also mentioned that you would like to modify the timespan for server side eviction? This defaults to a standard value however you can change this by implementing your own extension of InstanceConfig (see https://github.com/Netflix/eureka/blob/9711533554c62b472a7248b71764c56266ce0c8e/eureka-client/src/main/java/com/netflix/appinfo/EurekaInstanceConfig.java#L111). This governs the lease expiration duration per registering client.

divsrep...@gmail.com

unread,
Jun 29, 2017, 8:14:00 AM6/29/17
to eureka_netflix, maj12.p...@gmail.com
I tried with 2 eureka server and One deployed App Service gthat is registerd with Eureka, but it took around 2-3 mins to evict whereas I have defined them to 10 secs? What am I missing?

eureka-server.properties
========================
eureka.enableSelfPreservation=false
eureka.renewalPercentThreshold=0.05
eureka.leaseExpirationDurationInSeconds=10
eureka.leaseRenewalIntervalInSeconds=10
Reply all
Reply to author
Forward
0 new messages