All Products
Search
Document Center

Enterprise Distributed Application Service:Upgrade a single application by using end-to-end traffic adjustment

Last Updated:Aug 08, 2023

During application iterations, you can use end-to-end traffic adjustment to verify a new version on a small number of instances. After the verification succeeds, you can upgrade the applications on all instances to the new version.

Scenario

Web Application A V1 is deployed on two Elastic Compute Service (ECS) instances by using WAR packages. After Web Application A V2 is available, you must verify the application on one instance. After the verification succeeds, upgrade Web Application A V1 on the other instance to V2.

Canary release process

edas-AppDeploy-canary-singleApp.png
  1. Create a canary instance group.

  2. In the canary instance group, configure and enable a traffic adjustment rule.

  3. Deploy V2 in the canary instance group and check whether the specified traffic is distributed to the instance in the canary instance group.

  4. Verify V2 based on the traffic that is distributed to the canary instance group.

  5. After the verification succeeds, upgrade the application on the instance in the default group to V2.

    If issues occur during the verification, disable the traffic adjustment rule for the canary instance group and move the instance from the canary instance group to the default group. After you troubleshoot the issues, enable the traffic adjustment rule for the canary instance group again. Then, deploy and verify V2 in the canary instance group.

  6. Disable the traffic adjustment rule for the canary instance group and delete the canary instance group.

Step 1: Create a canary instance group

In ECS clusters, different versions of applications are deployed based on instance groups, and traffic adjustment rules are configured based on instance groups. Therefore, you must create a canary instance group first.

  1. Log on to the EDAS console.

  2. In the left-side navigation pane, choose Application Management > Applications. In the top navigation bar, select the region. In the upper part of the Applications page, select the microservice namespace from the Microservice Namespace drop-down list and then click the name of the desired application.

  3. On the application details page, click the Instance Information tab. Then, click Create Group in the upper part of the page.

  4. In the Create Group dialog box, set the Group Name parameter to Canary Instance Group and click Create.

    After the group is created, the message The group is created appears in the upper part of the page.

Step 2: Configure and enable a traffic adjustment rule

You can configure High-speed Service Framework (HSF) and HTTP traffic adjustment rules.

  • To configure an HTTP traffic adjustment rule, click the Basic Information tab and enable Traffic Management.

  • To configure an HSF traffic adjustment rule, you do not need to enable Traffic Management. However, make sure that Enterprise Distributed Application Service (EDAS) Container 3.5.3 or later is used.

The following procedure describes how to configure an HTTP traffic adjustment rule:

  1. In the Application Settings section of the Basic Information tab, click Enable next to Traffic Management.

  2. On the Instance Information tab, click Traffic Adjustment in the upper-right corner of the Canary Instance Group section and select HTTP Traffic Adjustment. edas-AppDeploy-canary-singleApp-trafficControl.png

  3. In the Traffic Adjustment dialog box, set the parameters and select Enable the following configuration to control HTTP request traffic that enters the current application instance group. Then, click Save.

    You can configure one of the following traffic adjustment rules for inbound traffic: Canary Release by Content and Canary Release by Ratio.

    • Canary Release by Content: distributes traffic that meets the configured rule to the canary instance group.

    • Canary Release by Ratio: distributes traffic to the canary instance group based on a specific proportion.

    The Canary Release by Ratio rule is easy to configure. The following sections describe how to configure the Canary Release by Content rule for inbound traffic.

    Traffic Adjustment

    Parameter settings for a traffic adjustment rule:

    • Conditional Mode: Select Meet All Following Conditions.

    • Conditions: Valid values are Cookie, Header, and Parameter. In this example, Parameter is used.

      • Parameters Type: Select Parameter.

      • Parameter: Enter version.

      • Conditions: Select =.

      • Value: Enter 1.

    Important

    After the parameters are set, you must select Enable the following configuration to control HTTP request traffic that enters the current application instance group to make the traffic adjustment rule take effect.

    If the canary instance group has no instances to receive the canary traffic after the traffic adjustment rule takes effect, the default group is automatically used.

Step 3: Deploy and verify the new version

  1. Move an instance to the canary instance group.

    1. Go back to the Instance Information tab. In the Default Group section, find the instance that you want to move to the canary instance group and click Change Group in the Actions column.

    2. In the Change Group dialog box, select Canary Instance Group from the Target Group drop-down list and click OK.

    After the instance is moved to the canary instance group, the version of the application on this instance is V1.

  2. Deploy the new version.

    You can deploy the new version by using the EDAS console or a tool. In this example, the new version is deployed in the EDAS console. For more information about how to deploy the new version by using tools, see Overview.

    1. In the upper part of the application details page, click Deploy Application.

    2. On the Select Deployment Mode page, click Start Deployment next to Regular Release (Single-batch/Multi-batch).

      Note

      In this example, V1 is deployed by using a WAR package. Therefore, you must select the WAR package to deploy V2. If you have deployed the application by using a JAR package, set the parameters for the JAR deployment method.

    3. Set the parameters for application deployment. Application deployment

      • Deployment Method: Select JAR.

      • File Uploading Method: Select Upload JAR Package and click Select File. In the dialog box that appears, select the local JAR package for V2.

      • Version: Enter V2.

      • Group: Select the canary instance group that you create.

      • Batches per Group: Select 1 Batches.

      • Batch Mode: Select Automatic.

      After the application is deployed, the Change Details page appears. You can view the deployment progress on this page. If the value of Execution Status is Executed, the deployment is successful. If the deployment fails, the related log appears on the Change Details page. You can check the log for troubleshooting.

      Go back to the application details page and click the Instance Information tab. On the Instance Information tab, the value of Package Version/MD5 is changed to V2, and the value of Running Status is changed to Normal in the canary instance group.

  3. Verify the traffic adjustment rule.

    1. In the browser address bar, enter http://<IP address of the instance in the default group>:<service port> and press Enter.

      The web page of Web Application V1 appears.

    2. In the browser address bar, enter http://<IP address of the instance in the default group>:<service port>? version=1 and press Enter.

      The web page of Web Application V2 appears.

    The results show that the traffic adjustment rule has taken effect, and the specified traffic is distributed to the instance in the canary instance group.

Step 4: Verify the new version

You can verify the new version based on your business requirements.

If issues occur during the verification, disable the traffic adjustment rule for the canary instance group and move the instance from the canary instance group to the default group. After you troubleshoot the issues, enable the traffic adjustment rule for the canary instance group again. Then, deploy and verify V2 in the canary instance group.

Step 5: Upgrade the application in the default group

After the verification succeeds, upgrade the application in the default group to V2.

To upgrade the application, you must deploy the application again. For more information about the procedure, see Step 3: Deploy and verify the new version.

Step 6: Disable the traffic adjustment rule and delete the canary instance group

After Web Application A V1 on the instances in both groups is upgraded to V2, you must disable the traffic adjustment rule and delete the canary instance group.

  1. On the Instance Information tab, click Traffic Adjustment in the upper-right corner of the Canary Instance Group section and select HTTP Traffic Adjustment.

  2. In the Traffic Adjustment dialog box, clear Enable the following configuration to control HTTP request traffic that enters the current application instance group and click Save.

  3. Go back to the Instance Information tab, find the instance in the canary instance group and click Change Group in the Actions column.

  4. In the Change Group dialog box, select Default Group from the Target Group drop-down list and click OK.

  5. Go back to the Instance Information tab, and click Delete Group in the upper-right corner of the Canary Instance Group section.