Skip to content

Latest commit

 

History

History
52 lines (32 loc) · 2.22 KB

readme.md

File metadata and controls

52 lines (32 loc) · 2.22 KB

Eureka Cluster

for testing Eureka things

Setup:

this needs entries in hosts (C:\WINDOWS\System32\drivers\etc\hosts on Windows):

for eureka replication to work, all eureka instaces must be running on different hosts

127.0.0.1 eureka-peer1
127.0.0.1 eureka-peer2
127.0.0.1 eureka-peer3

Running

use scripts provided in scripts/ folder to start individual services. You can use the monitor module to run a UI that shows active services and their caches to monitor the state of the cluster. The monitor uses

  • /eureka/apps endpoint of discovery services for discovered services
  • /actuator/health discoverycomposite part of the response for service cache

references for configuring:

https://thepracticaldeveloper.com/2018/03/18/spring-boot-service-discovery-eureka/#Eureka_Registry_Cluster_via_enabling_Peer_Awareness https://cloud.spring.io/spring-cloud-netflix/multi/multi_spring-cloud-eureka-server.html

interesting Eureka configuration

  • eureka.server.evictionIntervalTimerInMs

  • eureka.server.response-cache-update-interval-ms

  • eureka.client.registryFetchIntervalSeconds

  • initial-instance-info-replication-interval-seconds: 0

  • instance-info-replication-interval-seconds: 1

  • registry-fetch-interval-seconds: 1

Ribbon cache:

  • ribbon.serverListRefreshInterval / ribbon.ServerListRefreshInterval

If registerWithEureka is true, an instance registers with a Eureka server using a given URL; then onwards, it sends heartbeats every 30s (configurable by eureka.instance.leaseRenewalIntervalInSeconds). If the server doesn’t receive a heartbeat, it waits 90s (configurable by eureka.instance.leaseExpirationDurationInSeconds) before removing the instance from registry and there by disallowing traffic to that instance. Sending heartbeat is an asynchronous task; if the operation fails, it backs off exponentially by a factor of 2 until a maximum delay of eureka.instance.leaseRenewalIntervalInSeconds * eureka.client.heartbeatExecutorExponentialBackOffBound is reached. There is no limit to the number of retries for registering with Eureka.

actual configuration achieved