Configuration Center (Config, Bus)

1. Background

Today, micro-services architecture prevalent in distributed systems, increasingly large projects, subprojects increasing, each project is littered with various configuration files, and with the increase of services and growing. At this time, often one basic service information changes will lead to a series of updates and restart the service, operation and maintenance are struggling, too, and very prone to error. Configuration Center will be available in the market today, which came into the open source distribution center a lot, like Spring Cloud Config Spning family, Apache's ApacheCommons Configuration, Taobao diamond, Baidu's disconf, 360 of QConf, etc., are made to address such problem. Spring popular current system, we also had a preference for Spring Cloud Config.

2.Spring Cloud Config

Spring Cloud Config is a set of micro-infrastructure and service applications in distributed systems management solutions provide centralized configuration, divided into server and client in two parts is. Also known as a distributed server configuration center, is an independent micro-service applications, warehouse and configured to connect to the client for configuration information. The client is a micro-service architecture of each micro application service or infrastructure, which is managed by the service-related configuration content specified configuration center, and obtaining and loading configuration information from a configuration center at boot time.

Spring Cloud Config for server and client environment variables and attribute mapping configuration to achieve the abstract, so in addition apply to Spring applications, it can also be used in any other language applications. Spring Cloud Config achieve configuration center default using Git to store configuration information. So use Spring Cloud Config build configuration server natural to support version management for micro-service application configuration information, and can be easily managed through the Git client tools out of ten and access configuration content, of course, it also provides support for other storage methods, such as SVN repository, localization file system.

3.Spring Cloud Bus

Spring Cloud Bus message is commonly known as a bus, each node is connected via a message distribution agent lightweight meter, may be utilized as a message queue of messages broadcast mechanism propagates in a distributed system, a lot of business functions may be implemented via a message bus, for the configuration in which the center of a new client is not a very typical usage scenarios. FIG explain the effect of the process can be well message bus.

image

Step Spring Cloud Bus configuration updates are as follows:
(1) submit code trigger / actuator / bus-refresh post request to.
(2) Server receives the request and sends Cloud Bus the Spring.
(3) the Spring Cloud Bus received the news and inform other clients.
(4) Other client receives a notification requesting Server clients to obtain the latest configuration.
(5) all clients are to get the latest configuration.

Guess you like

Origin www.cnblogs.com/xc-xinxue/p/12543652.html