Commit 071bad21 by Ryan Baxter

Document Eureka client zone config. Fixes #31327

parent 027e7fc5
......@@ -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 <<spring-cloud-eureka-server-zones-and-regions,zones and regions>>
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment