El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.
- What's New
- Function Overview
- Service Overview
- Billing
- Getting Started
-
User Guide
- Before You Start
- Permissions Management
-
Exclusive ServiceComb Engine
- Creating a ServiceComb Engine
-
Managing ServiceComb Engines
- Viewing ServiceComb Engine Information
- Obtaining the Service Center Address of a ServiceComb Engine
- Obtaining the Configuration Center Address of a ServiceComb Engine
- Viewing the Instance Quota of a ServiceComb Engine
- Viewing the Configuration Item Quota of a ServiceComb Engine
- Configuring Backup and Restoration of a ServiceComb Engine
- Managing Public Network Access for a ServiceComb Engine
- Viewing ServiceComb Engine Operation Logs
- Upgrading a ServiceComb Engine Version
- Deleting a ServiceComb Engine
- Changing ServiceComb Engine Specifications
- Managing Security Authentication for a ServiceComb Engine
- Managing Tags
- Using ServiceComb Engines
- Registry/Configuration Center
- Key Operations Recorded by CTS
-
Best Practices
- CSE Best Practices
-
ServiceComb Engines
-
ServiceComb Engine Application Hosting
- Hosting Spring Cloud Applications Using Spring Cloud Huawei SDK
- Hosting a Java Chassis Application
-
ServiceComb Engine Application Hosting
- Registry/Configuration Centers
-
Developer Guide
- Overview
- Developing Microservice Applications
- Preparing the Environment
- Connecting Microservice Applications
- Deploying Microservice Applications
- Using ServiceComb Engine Functions
- Appendix
-
API Reference
- Before You Start
- API Overview
- Calling APIs
- Examples
-
CSE API
- API Calling
- Dynamic Configuration
-
Engine Management
- Querying Flavors Supported by a Microservice Engine
- Querying the Microservice Engine List
- Creating an Exclusive Microservice Engine
- Querying Details About a Microservice Engine
- Deleting a Microservice Engine
- Querying Details About a Microservice Engine Job
- Retrying an Exclusive ServiceComb Engine
- Upgrading an Exclusive ServiceComb Engine
- Changing Microservice Engine Specifications
- Updating the Configuration of an Exclusive Microservice Engine
-
Microservice Governance
- Querying the Governance Policy List
- Creating a Dark Launch Policy
- Querying a Dark Launch Rule of a Microservice
- Deleting a Dark Launch Policy
- Changing a Governance Policy
- Deleting a Governance Policy
- Querying Governance Policy Details
- Creating a Governance Policy
- Querying the Governance Policy List of a Specified Kind
- Nacos API
-
ServiceComb API
- API Calling
- Authentication
-
Microservice
- Querying Information About a Microservice
- Deleting Definition Information About a Microservice
- Querying Information About All Microservices
- Creating Static Information for a Microservice
- Deleting Static Information About Microservices in Batches
- Modifying Extended Attributes of a Microservice
- Querying the Unique Service or Schema ID of a Microservice
- Schema
-
Microservice Instance
- Registering a Microservice Instance
- Querying a Microservice Instance Based on service_id
- Deregistering a Microservice Instance
- Querying Details About a Microservice Instance
- Modifying the Extended Information About a Microservice Instance
- Modifying Status of a Microservice Instance
- Sending Heartbeat Information
- Querying a Microservice Instance by Filter Criteria
- Querying Microservice Instances in Batches
- Dependency
- Configuration Management
- Appendixes
- Change History
- SDK Reference
-
FAQs
- Precautions When Using Huawei Cloud CSE
- Nacos Engines
-
ServiceComb Engines
- How Do I Perform Local Development and Testing?
- How Can I Handle a Certificate Loading Error?
- What If the Header Name Is Invalid?
- What Is the Performance Loss of Mesher?
- Why Is "Version validate failed" Displayed When I Attempt to Connect to the Service Center?
- Why Is "Not enough quota" Displayed When I Attempt to Connect to the Service Center?
- What Should I Do If the Service Registration Fails After IPv6 Is Enabled for the Exclusive ServiceComb Engine with Security Authentication Enabled?
- What Is Service Name Duplication Check?
- Why Do I Have to Define Service Contracts?
- Why Are Microservice Development Framework and Netty Versions Unmatched?
- What Do I Need to Know Before Upgrading an Exclusive ServiceComb Engine?
- What Must I Check Before Migrating Services from the Professional to the Exclusive Microservice Engine?
- Why Is "Duplicate cluster name" Displayed?
- Error Message "the subnet could not be found" Is Displayed When the Access Address Fails to Be Processed During Engine Creation
- Why Is Error "does not match rule: {Max: 100, Regexp: ^[a-zA-Z0-9]{1,160}$|^[a-zA-Z0-9][a-zA-Z0-9_\-.]{0,158}[a-zA-Z0-9]$}"}" Reported?
- What Should I Do If SpringCloud Applications Fail to Connect to the Configuration Center of ServiceComb Engine 2.x?
- Why Could My the Global Configuration Not Be Modified?
- Obtain Configurations Failed
- Videos
- General Reference
Show all
Copied.
Configuration Center Overview
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.
- 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.
- 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.
- 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.
- Custom configuration
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot