-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEurekaDoubts
22 lines (13 loc) · 2.21 KB
/
EurekaDoubts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
https://github.com/Netflix/eureka/wiki/Understanding-eureka-client-server-communication
Fetch Registry
Eureka clients fetches the registry information from the server and caches it locally.
After that, the clients use that information to find other services.
This information is updated periodically (every 30 seconds) by getting the delta updates between the last fetch cycle and the current one.
The delta information is held longer (for about 3 mins) in the server, hence the delta fetches may return the same instances again.
The Eureka client automatically handles the duplicate information.
Renews threshold: a switch which controls the "self-preservation mode" of Eureka. If "Renews" is below "Renews threshold", the "self-preservation mode" is on.
self-preservation mode:
When the Eureka server comes up, it tries to get all of the instance registry information from a neighboring node. If there is a problem getting the information from a node, the server tries all of the peers before it gives up. If the server is able to successfully get all of the instances, it sets the renewal threshold that it should be receiving based on that information. If any time, the renewals falls below the percent configured for that value (below 85% within 15 mins), the server stops expiring instances to protect the current instance registry information.
In Netflix, the above safeguard is called as self-preservation mode and is primarily used as a protection in scenarios where there is a network partition between a group of clients and the Eureka Server. In these scenarios, the server tries to protect the information it already has. There may be scenarios in case of a mass outage that this may cause the clients to get the instances that do not exist anymore. The clients must make sure they are resilient to eureka server returning an instance that is non-existent or un-responsive. The best protection in these scenarios is to timeout quickly and try other servers.
Prefer IP Address
In some cases, it is preferable for Eureka to advertise the IP Adresses of services rather than the hostname. Set eureka.instance.preferIpAddress to true and when the application registers with eureka, it will use its IP Address rather than its hostname.