Reputation: 46
I'm currently having an issue when using Netflix Eureka and Zuul in a Spring Cloud environment using Docker.
My current setup is as follows: 3 Docker containers:
This setup works fine but troubles begin when I start playing with the scaling of the service. When I scale up, Zuul picks up the new servers after 30 seconds. That's fine by me. However, when I take down service containers, calls to Zuul can fail (with a HTTP errorcode 200!) because Zuul still thinks the servers are in the alive pool.
I'm using Spring Boot 1.3.6 and Spring Cloud 1.1.2
My questions:
Upvotes: 2
Views: 1585
Reputation: 5004
you dont have to inform zuul about change in list of servers, as its done underneath. Real issue here is that eureka decides to keep those instances in its registry. There is a rule: if less than 85% services respond to healthcheck, then eureka thinks its due to network failure/partition and keep all services in registry. This is VERY likely to happen if you for example has only 3 instances of your service. As you can imagine, if one switch off(33,3% of all 3 instances) eureka will ignore it and still serve this instance to clients.
It can be nice feature if you have 100 servers :) Its netflix tool tweaked mostly for their needs.
You can try to switch selfPreservation off:
eureka.server.enable-self-preservation=false
or tweak threshold to some lower value:
eureka.server.renewal-percent-threshold=0.85
Upvotes: 1