Simple use of Apollo configuration center

Apollo is an open source configuration center developed by the Ctrip Framework Department. It can centrally manage the configuration of applications in different environments and different clusters, which greatly facilitates configuration file management under the microservice architecture. After configuration changes, it can be pushed to the application side in real time without restarting the application. , And has standardized authority management, gray release, process management, etc., which is very suitable for microservice configuration management scenarios.
Downloading, installing and running are very simple, almost out of the box.
(0) First add a new project

Insert picture description here

(1) After the startup is successful, click to add a new namespace:

Insert picture description here

(2)

Insert picture description here

(3)

Insert picture description here

(4) Add configuration information under the newly added namespace, remember to click Publish

Insert picture description here

(5) Remember to introduce the new namespace in the yml configuration file

Insert picture description here

(6) Writing a controller is like reading the configuration from the configuration file normally

Insert picture description here

(7) The test is successful

Insert picture description here

This shows that we can configure all middleware or databases or some constant information on Apollo, and the yml file can be more concise than ever. It will be more convenient to modify, and there is no need to restart the application.

Guess you like

Origin blog.csdn.net/whiteBearClimb/article/details/109294573