You can extract the variables and parameters from the code of an application and save them in a configuration file. Then, you can modify the configuration of the application in the configuration file. This topic describes how to create a Nacos configuration.
Prerequisites
MSE is activated. If you do not activate MSE, go to the MSE product page to activate it.
An MSE Nacos instance is created. For more information, see Create a Nacos engine.
Microservices Registry supports Nacos 1.2.1 and later.
Create a configuration
Log on to the MSE console, and select a region in the top navigation bar.
In the left-side navigation pane, choose Microservices Registry > Instances.
On the Instances page, click the name of the instance.
In the left-side navigation pane, choose Configuration Management > Configurations.
In the upper-left corner of the Configurations page, select a namespace from the Namespace drop-down list, and click Add Configuration.
In the Add Configuration panel, configure the parameters and click Release.
Parameter
Description
Region
The default region to which the configuration belongs. You cannot modify this parameter.
Namespace
The default namespace to which the configuration belongs. You cannot modify this parameter.
Data ID
The configuration ID. We recommend that you specify an ID in the package.class format and replace class with a configuration name used to identify the configuration. Example: com.foo.bar.log.level. The value of this parameter must be unique in a group.
Group
The name of a group. We recommend that you enter a product name or a module name. The value of this parameter must be unique.
Data Encryption
Specifies whether to encrypt the configuration data. If the configuration contains sensitive data, we recommend that you turn on this switch to minimize the risk of data leaks. The data ID of an encrypted configuration starts with
cipher-. For more information, see Configure encryption.Configuration Format
The data format of the configuration content.
Description
The description of the configuration.
More Settings
Application: the name of the application to which the configuration belongs.
Configuration Tag: Enter a label keyword in the field and select a label from the drop-down list.
Configuration Content
In the Configuration Content section on the right side of the panel, enter the configuration content. Example:
threadPoolSize=5 logLevel=WARNNoteThe non-encrypted configuration content cannot exceed 100 KB in size, and the encrypted configuration content cannot exceed 50 KB in size. If the configuration content exceeds a size limit, split the configuration into multiple small configurations.
Changing the size of the configuration content may affect the stability of Nacos. To change the content size limit, go to Quota Center to request a quota adjustment.
After the configuration is created, it appears on the Configurations page.