Closed PierreBesson closed 5 years ago
I have actually tried to make this work a few weeks ago but was completely stuck. It's hard to make it work in our case as the registry and config server are embedded in the same app.
This feature would also require some changes to the registry as for example, the registry does not currently registers itself. More over, the Eureka does not registers its server replicas as regular eureka instances so ribbon cannot load balance calls from regular apps to registry instances.
If the registry and configserver were different apps, this would be easy to do, otherwise if we really want to make this work, we will need a hack akin to the ZuulUpdaterService to fiddle with the Eureka server internals.
So in the end, I suggest that we give up on this idea.
Have you considered setting multiple URLs in the spring.cloud.config.uri
property?
Oh no and this is a new feature but it could solve the problem ! Nice find.
My app is very far behind Spring Cloud latest version so I may rather use DNS load balancing.
Hello @gmarziou, I am stuck in a similar problem. Setting multiple URLs in spring.cloud.config.uri property would mean multiple URLs pointing to same repository? Another one can be a DR URL?
Regarding the DNS load balancing. How do we provide login credentials for the same?
Thanks
Hello @savirs, this is an issue tracker not a discussion forum. If you have questions please use our chat room on gitter or use Stack Overflow, and tag the question with jhipster.
And sorry but I did not understand your points.
As this has been stuck for a long time, even with the $100 tag, I'm closing this as "won't fix".
Overview of the issue
Currently, our Spring Cloud Config setup is such that the application will first query the config server (at the single URL defined in
spring.cloud.config.uri
), update their config and then register with Eureka. This is a problem when using an HA registry (in cluster) as it means that you cannot have HA for the config server.To illustrate the problem, here is an example (this actually happened in our production) with a replicated registry and microservice on 2 nodes:
On node1, microservice-1 (configured with env vars) will retrieve it's configuration from registry-1. On node2, microservice-2 (configured with env vars) will retrieve it's configuration from registry-2.
We temporarily lose node 2 and restart it. In our current default configuration, microservice 2 will actually fail to restart as long as registry-2 remains unavailable. For me, it is not acceptable that failure of one registry make all applications configured to use it fail to start.
Motivation for or Use Case
Provide full HA for the JHipster Registry including the config server and correctly load balance calls from microservices to the config server using Eureka and Ribbon.
Suggest a Fix
Configure applications to use Spring Cloud config Discovery First Bootstrap mode which uses Eureka to find all available config server URLs and will load balance request using Ribbon.
JHipster Version(s)
v3, v4, v5 beta and v5.0