Reputation: 2226
I deployed 3 Eureka servers. A peers with B, B peers with C, C peers with A. I also have a client with eureka.client.service-url.defaultZone=Eureka A's address
. When I started my client, things were wired:
Eureka A and B had my client's registry info, but server C got nothing. I waited for 5mins server C still got nothing. I think server C should have client's registry info because server C peers with Server A, so C will sync registry with A. What's wrong here?
Thanks!
Upvotes: 1
Views: 1253
Reputation: 1955
You need to list the other server in each server's configuration. So in your case in each registry there should 2 entries for the defaultZone. In the clients you can also specify multiple servers with the same property.
eureka.client.serviceUrl.defaultZone=http://<peer1host>:<peer1port>/eureka,http://<peer2host>:<peer2port>/eureka
As discussed here: How to config multiple Eureka Servers from client in Spring Cloud
Extra info: http://cloud.spring.io/spring-cloud-static/spring-cloud.html#_peer_awareness
Upvotes: 2