Halaman ini belum tersedia dalam bahasa lokal Anda. Kami berusaha keras untuk menambahkan lebih banyak versi bahasa. Terima kasih atas dukungan Anda.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Configuration Center Overview

Updated on 2024-08-14 GMT+08:00

The configuration center is used to manage microservice application configurations. Microservices connect to the configuration center to obtain the information and changes of configurations. The configuration center is also the core component for the management functions of other microservices. For example, service governance rules are delivered through the configuration center.

ServiceComb engines support config-center and kie.

NOTE:
  • For ServiceComb engine 1.x, the value is config-center.
  • For ServiceComb engine 2.x, the value is kie (recommended) or config-center.

This section describes the development details of different microservice development frameworks using the configuration center, including how to configure dependencies and connect to configuration items related to the configuration center, and how to read configurations and respond to configuration changes in microservice applications.

  • ServiceComb engines use kie as the configuration center.

    By default, microservices read application configurations, service configurations, and custom configurations from the configuration center. Application configuration refers to the configuration of the same environment and application as the microservice. Service configuration refers to the configuration of the same environment, application, and microservice name as the microservice. A microservice can specify a specific label and label value in the configuration file. Custom configuration refers to the configuration of the same label and label value as the microservice.

    Application- and service-level configurations are applicable to simple scenarios. The application-level configuration is shared by all microservices of the application. The service-level configuration is exclusive and takes effect only for specific microservices.

    In complex scenarios, customLabel and customLabelValue can be used to define configurations. For example, if some configurations are shared by all applications, this method can be used. Add the following configuration to the configuration file (Spring Cloud is used as an example):
    spring:
      cloud:
        servicecomb:
          config:
            kie:
              customLabel: public # The default value is public.
              customLabelValue: default # The default value is a null string.

    If a configuration item has the public label and the label value is default, the configuration item takes effect for the microservice.

    1. The configuration center is considered as the table tbl_configurations of the database. The key is the primary key, and each label is an attribute.
    2. The client queries the configuration based on the following search criteria:
      • Custom configuration

        select * from tbl_configurations where customLabel=customLabelValue & match=false

      • Application-level configuration

        select * from tbl_configurations where app=demo_app & environment=demo_environment & match=true

      • Service-level configuration

        select * from tbl_configurations where app=demo_app & environment=demo_environment & service=demo_service & match=true

      When match is set to true, only the attributes specified in the condition are available. When match is set to false, all attributes except those in the condition are allowed. You can also specify multiple applications for label app or services for label service. In this way, the configuration item takes effect for multiple services and applications.

    For ServiceComb engines of the TEXT and XML types, SDK uses the content as key-value pairs. For CSE of the YAML and Properties types, SDK parses the content and the application uses the content as the actual application configuration items. For example,

    Type: TEXT
    key: cse.examples.hello
    value: World
    

    One configuration item is found in the application: cse.examples.hello = World.

    Type: YAML
    key: cse.examples.hello
    value: |
       cse:
         key1: value1
         key2: value2
    

    Two configuration items are found in the application: cse.key1 = value1 and cse.key2 = value2.

  • ServiceComb engines use config-center as the configuration center.

    By default, microservices read global configurations and service configurations from the configuration center. Global configuration refers to the environment shared by the microservice engine and microservice. Service configuration refers to the microservice engine's environment, application, and microservice name that are the same as the microservice's.

    ServiceComb engines support only key-value configuration items. To use a configuration file in YAML format, you can use the fileSource function provided by SDK. After the key list of fileSource is specified in the configuration file, SDK parses the values of these keys as YAML files. The following uses Spring Cloud as an example to describe how to add a configuration item to the bootstrap.yml file.

    spring:
      cloud:
        servicecomb:
          config:
            fileSource: file1.yaml,file2.yaml

    In addition, create configurations in the configuration center. The following table lists the configuration items and their values. The value is in YAML format.

    Item

    Value

    file1.yaml

    cse.example.key1: value1
    cse.example.key2: value2

    file2.yaml

    cse.example.key3: value3
    cse.example.key4: value4

    For details about how to create a microservice, see Configuration Management (Applicable to Engine 1.x).

    Four configuration items are found in the application: cse.example.key1=value1, cse.example.key2=value2, cse.example.key3=value3, and cse.example.key4=value4.

Kami menggunakan cookie untuk meningkatkan kualitas situs kami dan pengalaman Anda. Dengan melanjutkan penelusuran di situs kami berarti Anda menerima kebijakan cookie kami. Cari tahu selengkapnya

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback