Help Center> Cloud Service Engine> FAQs> ServiceComb Engines> What Do I Need to Know Before Upgrading an Exclusive ServiceComb Engine?
Updated on 2024-05-16 GMT+08:00

What Do I Need to Know Before Upgrading an Exclusive ServiceComb Engine?

There are several problems that may occur during and after the upgrade from 1.x to 2.x. The following are their symptoms and solutions.

  • Symptom 1: During the upgrade, the configuration could not be obtained or updated using the API, showing the error "Connection refused" or "Connection was closed". Error examples:
    [ERROR] Config update from xxx.xxx.xxx.xx failed. Error message is [Connection refused: xxx.xxx.xxx.xx]. org.apache.servicecomb.config.client.ConfigCenterClient$ConfigRefresh.lambda$null$13(ConfigCenterClient.java:428)

    [ERROR]Config update from xxx.xxx.xxx.xx failed. Error message is [Connection was closed]. org.apache.servicecomb.config.client.ConfigCenterClient$ConfigRefresh.lambda$null$13(ConfigCenterClient.java:428)

    Solution: The configuration center restarts for a short period of time when upgrading. During this restart, the configuration is obtained or updated, causing a disconnection error. To avoid this error, do not update the configuration during the upgrade.

  • Symptom 2: Service scenario governance is unavailable when using an engine 1.x to access the configuration center.

    Solution: The configuration center of the engine 2.x has changed to kie, so switch the access mode of the configuration center to kie. For details, see Using the Configuration Center in Spring Cloud.

  • Symptom 3: When you import a configuration file in the original 2.x configuration center format, the import fails and a message is displayed indicating that the file is empty or the format is incorrect.

    Solution: Change the format of the configuration items in the configuration file as required by the engine 2.x. The new configuration file is a JSON file with the following format:

    {
        "data":[
            {
                "key":"xxx",
                "labels":{
                    "environment":"xxx",
    		"service": "xxx",
    		"app": "xxx",
    		"version": "xxx"
                },
                "value":"xxx",
                "value_type":"text",
                "status":"enabled"
            },
    		{
                "key":"xxx",
                "labels":{
                    "environment":"xxx"
                },
                "value":"xxx",
                "value_type":"text",
                "status":"enabled"
            },
    		{
                "key":"xxx",
                "labels":{
                    "environment":"xxx",
    		"service": "xxx"
                },
                "value":"xxx",
                "value_type":"text",
                "status":"enabled"
            },
    		{
                "key":"xxx",
                "labels":{
                    "environment":"xxx",
    		"service": "xxx",
    		"app": "xxx"
                },
                "value":"xxx",
                "value_type":"text",
                "status":"enabled"
            }
        ]
    }

    where,

    • key and value are mandatory: key and value of the configuration item
    • labels is mandatory: configuration range, determined by setting the environment, service, app, and version fields
    • value_type is mandatory: configuration item type. Value: ini, json, text (default), yaml, properties, or xml
    • status is optional: whether to enable the configuration. Value: enabled or disabled (default)
  • Symptom 4: If the global configuration is set in the configuration center of ServiceComb engine version 1.x, after the version is upgraded to 2.x, the global configuration automatically adjusts the application scope environment=${environmentName}. The value of environmentName can be empty, development, testing, acceptance, or production. If the SDK uses Kie as the configuration center, you need to add a custom tag to the project configuration file to obtain the configuration. The following uses environment=production as an example:

    spring-cloud-huawei framework:

    spring:
      cloud:
        servicecomb:
          config:
            serverType: kie
            kie:
              customLabel: environment
              customLabelValue: production
    servicecomb-java-chassis framework:
    servicecomb:
      kie:
        customLabel: environment
        customLabelValue: production

ServiceComb Engines FAQs

more