Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the introduction of the core concepts and core functions of SpringCloud-Apollo distributed configuration center?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article shows you how the core concepts and core functions of SpringCloud-Apollo distributed configuration Center are introduced. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

Apollo (Apollo) is a distributed configuration center developed by Ctrip Framework Department, which can centrally manage the configuration of applications in different environments and clusters. After configuration modification, it can be pushed to the application in real time, and has standardized permissions, process governance and other features, so it is suitable for micro-service configuration management scenarios.

The server is developed based on Spring Boot and Spring Cloud, which can be packaged and run directly without additional installation of application containers such as Tomcat.

The Java client does not rely on any framework and can run in all Java runtime environments. It also has good support for the Spring/Spring Boot environment.

The core function point of Apollo is 1. Uniformly manage the configuration of different environments and clusters

Apollo provides a unified interface for centralized management of configurations in different environments (environment), different clusters (cluster), and different namespaces (namespace).

The same code is deployed in different clusters and can have different configurations, such as the address of zk. Namespaces (namespace) can easily support multiple different applications to share the same configuration, while allowing applications to overwrite the shared configuration.

two。 Configuration changes take effect in real time (hot release)

After the user modifies the configuration and publishes it in Apollo, the client can receive the latest configuration in real time (1s) and notify the application.

3. Version release management

All configuration releases have a version concept, so that configuration rollback can be easily supported.

4. Grayscale release

Support the grayscale release of configuration, for example, only take effect for some application instances after clicking publish, wait for a period of time, confirm that there is no problem, and then push it to all application instances.

5. Rights management, release audit, operation audit

The management of application and configuration has a perfect authority management mechanism, and the management of configuration is divided into two links: editing and publishing, so as to reduce human errors.

All operations have audit logs to facilitate tracking of problems.

6. Client configuration information monitoring

You can easily see which instances the configuration is used by.

7. Provide Java and .net native clients

It provides native clients of Java and .net to facilitate application integration. ConfigurationProperties that supports Spring Placeholder, Annotation and Spring Boot, which is convenient for applications (requires Spring 3.1.1 +).

At the same time, it provides a Http interface, which can also be easily used by non-Java and .net applications.

8. Provide an open platform API

Apollo itself provides a relatively complete unified configuration management interface, supporting multi-environment, multi-data center configuration management, permissions, process governance and other features. However, for the sake of generality, Apollo does not make too many restrictions on configuration changes, and can be saved as long as it conforms to the basic format.

In our research, we found that for some users, their configuration may have more complex formats, such as xml and json, which need to be checked. Other users, such as DAL, not only have a specific format, but also need to verify the entered values before they can be saved, such as checking whether the database, user name, and password match.

For this kind of application, Apollo supports the application side to modify and publish the configuration in Apollo through open interface, and has perfect authorization and permission control.

9. Simple deployment

The configuration center, as a basic service, requires very high availability, which requires Apollo to rely as little on the outside as possible.

Currently, the only external dependency is MySQL, so deployment is very simple, as long as you install Java and MySQL, you can get Apollo running.

Apollo also provides packaging scripts that generate all the required installation packages with one click and support custom runtime parameters.

Apollo core concept 1. Application

The application is our project, and the Apollo client needs to know the identity of the application at run time, so that the configuration center can obtain the corresponding configuration according to this identity. The identity of the application is specified by APPid. There are many ways to specify APPid. It is recommended to configure the application.properties directly in the Spring Boot project and follow the project.

two。 Environment

Environment is the common development, testing, production and so on, and the corresponding configuration contents of different environments are different. At run time, the Apollo client needs to know not only the current identity of the project, but also the corresponding environment of the current project, so that the configuration center can obtain the corresponding configuration according to the environment.

There are several ways to specify the current environment of the project, either through Java System Property or through a configuration file.

Currently, the supported environments are Local (local environment, loading local configuration), DEV (development environment), FAT (test environment), UAT (integrated environment) and PRO (production environment).

3. Cluster

In a multi-computer room environment, we can divide into different clusters for different computer rooms, and clusters can have different configurations. There are many ways to specify a project corresponding to a cluster, which can be specified through Java System Property or configuration files.

4. Namespace

Namespaces can be used to classify configurations, and different types of configurations are stored in different namespaces, such as database configuration files, message queue configurations, business-related configurations, and so on. Another common feature of namespaces is that multiple projects share the same configuration, such as the Redis cluster configuration.

5. Authority control

Through permission control, the configuration can be prevented from being misoperated by irrelevant people. For developers, only the permission to modify and publish the test environment can be assigned, and only the person in charge can have the permission of the formal environment.

The above content is the core concept and core function introduction of SpringCloud-Apollo distributed configuration center. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report