Can i have more than one Spring Cloud Config Server?

ε祈祈猫儿з 提交于 2019-12-22 05:34:13

问题


I understand that i can use more than 1 repositories to distribute my configurations across multiple repositories (probably for each application) but, can I run more than 1 Config servers for these repositories , so that we can avoid a single point of failure a the 'Config Server'.

If we can run multiple config servers, how do i abstract my client's from accessing any one particular config server ?

Update (after further reading): instead of using IP in the URI, if i use a URL which load balances multiple IPs, will it solve my problem of single point of failure at Config Server ?

spring.cloud.config.uri: http://myconfigserver.com


回答1:


Spring cloud server can register itself with eureka. Check this out-> http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#eureka-first-bootstrap




回答2:


I just tested Spring Cloud Config Server with Spring Cloud Bus in Cloud Foundry. When scaled up to multiple instances, a trigger to the server's /monitor endpoint causes all other instances to be updated, too. Furthermore, when shutting down a few instances, the clients are still able to get information from the other instances. So long story short, it works as expected.

To answer your other question: Yes, you need some way of addressing "one of many" servers. That can be done using DNS, but you might also want to use Eureka or some other service discovery mechanism for this. In Cloud Foundry you get a simple solution out of the box, namely a DNS entry that when used automatically connnects to a running instance.




回答3:


I have a similar scenario where I have several instances of Spring Config server. These instances are registered on Eureka server instances through a VIP. I have several gateway server (Zuul) instances registered also on Eureka server instances. But instead of using a bus to notify gateway server instances of config changes, I have added a custom listener on RefreshRemoteApplicationEvent event to notify gateway server instances fetched from eureka. But I don't see synchronization between my Spring Config Server instances.

I'm interested to know which listener in code reacts to /monitor endpoint call to notify others Spring Config server instances. Behind /monitor endpoint, there is org.springframework.cloud.config.monitor.PropertyPathEndpoint class but I don't see which listener do Spring Config server instances synchronization.

Best Regards.



来源:https://stackoverflow.com/questions/29604163/can-i-have-more-than-one-spring-cloud-config-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!