From 4b40a45016da03478f41d08b65441dc6312b1842 Mon Sep 17 00:00:00 2001 From: Will Tran Date: Wed, 17 Aug 2016 12:08:49 -0400 Subject: [PATCH] Fix for #1251 Example uses the same value of eureka.client.serviceUrl.defaultZone for all peers. The eureka server knows who it is and doesn't attempt to replicate to itself [1], so this simplification will work. [1]https://github.com/Netflix/eureka/blob/v1.4.10/eureka-core/src/main/java/com/netflix/eureka/registry/PeerAwareInstanceRegistryImpl.java#L616-L619 --- .../main/asciidoc/spring-cloud-netflix.adoc | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/docs/src/main/asciidoc/spring-cloud-netflix.adoc b/docs/src/main/asciidoc/spring-cloud-netflix.adoc index 89998eaa6..237d01e48 100644 --- a/docs/src/main/asciidoc/spring-cloud-netflix.adoc +++ b/docs/src/main/asciidoc/spring-cloud-netflix.adoc @@ -424,10 +424,37 @@ on a machine that knows its own hostname (it is looked up using `java.net.InetAddress` by default). You can add multiple peers to a system, and as long as they are all -connected to each other by at least one edge, they will synchronize -the registrations amongst themselves. If the peers are physically -separated (inside a data centre or between multiple data centres) then -the system can in principle survive split-brain type failures. +directly connected to each other, they will synchronize +the registrations amongst themselves. + +.application.yml (Three Peer Aware Eureka Servers) +---- +eureka: + client: + serviceUrl: + defaultZone: http://peer1/eureka/,http://peer2/eureka/,http://peer3/eureka/ + +--- +spring: + profiles: peer1 +eureka: + instance: + hostname: peer1 + +--- +spring: + profiles: peer2 +eureka: + instance: + hostname: peer2 + +--- +spring: + profiles: peer3 +eureka: + instance: + hostname: peer3 +---- === Prefer IP Address