diff --git a/docs/src/main/asciidoc/spring-cloud-netflix.adoc b/docs/src/main/asciidoc/spring-cloud-netflix.adoc index 78ad8a63..477e0c4f 100644 --- a/docs/src/main/asciidoc/spring-cloud-netflix.adoc +++ b/docs/src/main/asciidoc/spring-cloud-netflix.adoc @@ -305,6 +305,33 @@ production it's probably better to stick with the default because there are some computations internally in the server that make assumptions about the lease renewal period. + +=== Zones + +If you have deployed Eureka clients to multiple zones than you may prefer that +those clients leverage services within the same zone before trying services +in another zone. To do this you need to configure your Eureka clients correctly. + +First, you need to make sure you have Eureka servers deployed to each zone and that +they are peers of each other. See the section on <> +for more information. + +Next you need to tell Eureka which zone your service is in. You can do this using +the `metadataMap` property. For example if `service 1` is deployed to both `zone 1` +and `zone 2` you would need to set the following Eureka properties in `service 1` + +*Service 1 in Zone 1* +``` +eureka.instance.metadataMap.zone = zone1 +eureka.client.preferSameZoneEureka = true +``` + +*Service 1 in Zone 2* +``` +eureka.instance.metadataMap.zone = zone2 +eureka.client.preferSameZoneEureka = true +``` + [[spring-cloud-eureka-server]] == Service Discovery: Eureka Server @@ -362,6 +389,7 @@ dependencyManagement { ---- ==== +[[spring-cloud-eureka-server-zones-and-regions]] === High Availability, Zones and Regions The Eureka server does not have a backend store, but the service