Eureka Failover Options

285 views
Skip to first unread message

amardee...@gmail.com

unread,
Sep 13, 2016, 10:33:31 AM9/13/16
to eureka_netflix
We are using Eureka failover strategy to meet one our requirement where we expect the following:

By default eureka client should always connect to primary eureka server.
When Primary eureka server is not reachable it fallback to another eureka server as configured.
When primary eureka server comes online the subsequent load from the client shifts to this server only and the backup server should become idle.

Have tried the Eureka failover as per the documentation and here is what I observed.

Eureka client connects to any server listed on the zone.
On fallback scenario, eureka client connects to another eureka server listed in zone.
Once the server comes back online , eureka client still serving from the backup server.

Here are the configuration:
eureka:
client:
register-with-eureka: true
fetch-registry: true
availability-zones:
us-east-1: us-east-1a,us-east-1b
region: us-east-1
prefer-same-zone-eureka: true
service-url:
us-east-1a: http://localhost:9771/eureka/
us-east-1b: http://localhost:9762/eureka/


Now my question is that if we need to build the customized solution to meet our requirements then what all options we have in our application to modify the existing behavior. Any insight on it is appreciated.

-Amardeep

dl...@netflix.com

unread,
Sep 14, 2016, 10:03:49 PM9/14/16
to eureka_netflix, amardee...@gmail.com
Hi Amardeep,

From the way your configs looks, I assume you are using the spring-cloud-netflix packaged eureka? For questions relating to these, a better place to ask is their github page (as an issue perhaps).
Depending on the version of eureka you are using, default fallback in the java eureka client should have the following characteristics:
1. Each client picks a statically randomized remote server as its "primary" server, with all other servers are fallback servers
2. Connects to server are sessioned at 20min +/- some jitter
3. If connection to a server fails, a new session is started stepping down the list of available remote servers until one is found
4. Connection stays with this (new) remote server until the session expires after which a server will be picked for the next session. If the original server that served as the "primary" server is now back up, it will be at the top of the list for the next session creation.

Hope that helps,
Thanks.

haris...@gmail.com

unread,
Jun 30, 2017, 6:49:16 AM6/30/17
to eureka_netflix, amardee...@gmail.com

Hi Amardeep,

would you mind sharing how did you configure Eureka Client to multiple region support. Even I am setting up similar setup as you had described above.

Thanks
Harish

Reply all
Reply to author
Forward
0 new messages