All Products
Search
Document Center

Microservices Engine:Create a configuration

Last Updated:Sep 02, 2024

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

Note

Microservices Registry supports Nacos 1.2.1 and later.

Create a configuration

  1. Log on to the MSE console, and select a region in the top navigation bar.

  2. In the left-side navigation pane, choose Microservices Registry > Instances.

  3. On the Instances page, click the name of the instance.

  4. In the left-side navigation pane, choose Configuration Management > Configurations.

  5. In the upper-left corner of the Configurations page, select a namespace from the Namespace drop-down list, and click Add Configuration.

  6. 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 ID of the configuration. 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 Create and use encrypted configurations.

    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.

    • Tags: Enter a tag and click the option that appears.

    Configuration Content

    In the Configuration Content section on the right side of the panel, enter the configuration content. Example:

    threadPoolSize=5
    logLevel=WARN
    Note

    The 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.

    If you adjust the size of your configuration content, the performance of your Nacos instance may be unstable. If you need to adjust the configuration content size, submit a ticket to contact the MSE technical support.

    After the configuration is created, it appears on the Configurations page.