介绍
Config是一个分布式配置管理系统,它提供了一个中心化的配置服务器来管理应用程序的配置信息。它允许开发人员将应用程序的配置信息存储在一个集中的位置,并将这些配置信息分发给多个应用程序实例。Config支持多种后端存储,包括Git、Redis、高斯数据库、本地文件系统等。它还提供了一组REST API,可以用于动态获取配置信息,以便应用程序能够及时更新自己的配置。通过使用Config,开发人员可以轻松地管理和更新应用程序的配置信息,从而提高应用程序的可维护性和可扩展性。
Config Server是一个可横向扩展、集中式的配置服务器,它用于集中管理应用程序各个环境下的配置。
特性
- 🚀 支持Git、Redis、AWS S3、本地文件系统、高斯数据库存储配置信息。
- 🚀 配置文件支持json、yaml格式。
- 🚀 存储配置文件支持json、yaml、properties格式。
- 🚀 多种配置存储方式同时生效并可设置优先级。
- 🚀 一次获取多版本配置文件信息。
- 🚀 客户端从服务端拉取配置可开启安全校验。
- 🚀 提供获取配置的纯文本格式和二进制流格式,其中yaml、json、properties格式支持配置信息解密。
- 🚀 提供获取服务加解密功能运行状态接口。
- 🚀 提供加解密接口配置文件内容支持3DES和RSA加解密,RSA加解密通过密钥库文件可使用多对密钥。
- 🚀 提供自定义加解密。
- 🚀git存储配置信息可设置对配置文件名称的模式匹配
- 🚀 配置的EnvironmentRepository健康检测。
- 🚀 兼容Spring Cloud Config Client。
架构图
源码目录
.
├── README.md
├── access.log
├── build.cj
├── cjpm.lock
├── cjpm.toml
├── doc
├── generate
│ └── silo_woods_generator
├── profile
│ ├── client.properties
│ └── master
│ ├── client-dev.properties
│ ├── client-prod.json
│ └── client.yml
├── rebuild.sh
├── resources
│ ├── applicationContext.json
│ ├── config.cks
│ ├── config_server
│ │ ├── application.json
│ │ └── application.yml
│ ├── db-init
│ │ └── openguass
│ │ └── schema-jdbc.sql
│ ├── private.pem
│ ├── rsa_public.pem
│ ├── session.json
│ ├── spirit.xml
│ └── sqls
│ └── config_server_sql_config.xml
├── src
│ ├── config_server
│ │ ├── common
│ │ │ ├── config_utils
│ │ │ │ ├── encrypt_util.cj
│ │ │ │ ├── import.cj
│ │ │ │ ├── read_profiles.cj
│ │ │ │ ├── to_string.cj
│ │ │ │ └── yaml_to_proerties.cj
│ │ │ └── model
│ │ │ ├── config_case.cj
│ │ │ ├── config_properties.cj
│ │ │ ├── environment.cj
│ │ │ ├── health.cj
│ │ │ ├── import.cj
│ │ │ ├── key_store.cj
│ │ │ └── property_sources.cj
│ │ ├── connection
│ │ │ ├── db_connection_proxy.cj
│ │ │ ├── redis_connection.cj
│ │ │ └── s3_connection.cj
│ │ ├── controller
│ │ │ ├── encryption_controller.cj
│ │ │ ├── environment_controller.cj
│ │ │ ├── import.cj
│ │ │ └── resource_controller.cj
│ │ ├── encryption
│ │ │ ├── cipher_environment_encryptor.cj
│ │ │ ├── default_encryptor_locator.cj
│ │ │ ├── default_secret_encryptor.cj
│ │ │ ├── environment_prefix_helper.cj
│ │ │ ├── import.cj
│ │ │ ├── text_encryptor.cj
│ │ │ └── text_encryptor_locator.cj
│ │ ├── environment
│ │ │ ├── awsS3_environment_repository.cj
│ │ │ ├── cdbc_environment_repository.cj
│ │ │ ├── environment_repository.cj
│ │ │ ├── import.cj
│ │ │ ├── native_environment_repository.cj
│ │ │ └── redis_environment_repository.cj
│ │ ├── initialization
│ │ │ └── profiles_initialization.cj
│ │ └── interceptor
│ │ └── securit_interceptor.cj
│ ├── config_server_test
│ │ ├── confiig_file
│ │ │ ├── application.json
│ │ │ ├── application.yml
│ │ │ ├── applicationContext.json
│ │ │ ├── copy
│ │ │ └── test_yml_to_properties.json
│ │ └── resource_controller_test.cj
│ ├── generated
│ │ ├── ioc
│ │ │ └── initialization
│ │ │ ├── AppContextInit.cj
│ │ │ ├── IOCImport.cj
│ │ │ └── seed_bag_pack_0.cj
│ │ └── plugin
│ │ └── initialization
│ │ └── ext_plugin_file.cj
│ └── main.cj
└── start.sh
doc
存放库的设计文档、提案、库的使用文档、LLT 覆盖率报告profile
配置文件存储在本地系统示例resources
config_server的配置文件、数据库初始化脚本、密钥、数据库配置src/config_server
存放config核心代码src/config_server_test
存放测试用例,包括 HLT 用例、LLT 用例和 UT 用例
使用说明
编译
cjpm build
配置
在服务端下中的resources/config_server添加application.json或application.yml
{
"config": {
"server": {
"repository": {
"active": "native",
"native": {
"path": "./profile",
"order": 3
},
"cdbc": {
"type": "opengauss",
"url":