If you want to upgrade an application that contains multiple instances, you can upgrade the application instances to different versions by using the canary release or phased release method based on your business requirements. This topic describes the phased release method. This topic also describes how to perform a phased release for an application and how to roll back an application.

Prerequisites

The number of instances in the application for which you want to perform a phased release is greater than 1.

Background information

Phased release is used to deploy the new version of the application instances in batches. If an error occurs during a phased release, you can terminate the process and roll back the application. You can release the application again after the error is fixed.

The instances of an application are evenly allocated to each batch for deployment during a phased release. You can specify the manual or automatic mode to release each batch. If the instances cannot be evenly allocated to each batch, the number of instances that are allocated to the last batch is greater than the number of instances that are allocated to each of the previous batches.

Important You can perform phased releases for only applications that contain more than one instance. If you use IntelliJ IDEA and specify command arguments to perform a phased release for an application that contains only one instance, an error is reported.

Procedure

Warning After you redeploy an application, the application is restarted. To prevent unpredictable errors such as business interruptions, we recommend that you deploy applications during off-peak hours.
  1. Log on to the SAE console.
  2. In the left-side navigation pane, click Applications. In the top navigation bar, select a region. Then, click the name of an application.
  3. In the upper-right corner of the Basic Information page, click Deploy Application.
  4. Configure deployment parameters.
    Note The deployment method of an application is based on the deployment method that you selected for the application for the first time. Configure the parameters based on the selected method.
    • Deployment with WAR Packages: Upload another WAR package or enter the path of a newly deployed WAR package, and configure the runtime environment and other settings.
    • Deployment with JAR Packages: Upload another JAR package or enter the path of a newly deployed JAR package, and configure the runtime environment and other settings.
    • Deployment with ZIP Packages: Upload another ZIP package or enter the path of a newly deployed ZIP package, and configure the runtime environment and other settings.
    • Image: In the Configure Image section, click Modify Image. In the Modify Image panel, select another image repository or image version.
  5. In the Release Policy Settings section, configure a phased release. The following table describes the parameters.
    Configure a phased release policy
    Parameter Description
    Release Policy Select Phased Release.
    Release BatchThe number of batches in which you want to release the instances.
    Batch ModeThis parameter is required If you set the Release Batch parameter to a value that is greater than 1. Select Automatic or Manual.
    Interval Between BatchesThis parameter is required if you set the Release Batch to a value that is greater than 1 and set the Batch Mode parameter to Automatic. Unit: minutes. Valid values: 0 to 30.
    Interval Within BatchThe time interval at which the application instances in a batch are deployed if the number of application instances in each batch is greater than 1. Unit: seconds.
    Minimum Available Instances

    This topic describes the reused The minimum number of available instances per rolling upgrade.

    • By Number: Enter the minimum number of available instances. If you select Use System Recommended Value, the minimum number of available instances is set to 25% of the number of existing instances.
    • By Ratio: Enter a percentage.
    Note
    • Make sure that at least one instance is available during application deployment and rollback. This ensures business continuity. If you set the value to 0, business interruptions occur when the application is upgraded.
    • If you specify a percentage, the minimum number of available instances is rounded up to the nearest integer. For example, five instances are available and you specify 25%. In this case, the minimum number of available instances is 2.
  6. Optional:Configure the advanced settings based on your business requirements.

    Java

    Advanced settingReferences
    Startup Command SettingsConfigure a startup command
    Java Tomcat SettingsConfigure Java Tomcat parameters
    Note You can configure Tomcat settings only if the Application Deployment Method parameter is set to Deployment with WAR Packages.
    Environment Variable SettingsConfigure environment variables
    Hosts Binding SettingsConfigure host bindings
    Application Health CheckConfigure application health checks
    Application Outbound/Inbound Internet Access
    Application Lifecycle ManagementConfigure application lifecycle management
    Log Collection Service
    Persistent StorageConfigure NAS storage
    Configuration ManagementInject configurations

    PHP

    Advanced settingReferences
    Modify php.ini Configuration FileConfigure a configuration file for a PHP application
    Startup Command SettingsConfigure a startup command
    Environment Variable SettingsConfigure environment variables
    Hosts Binding SettingsConfigure host bindings
    Application Health CheckConfigure application health checks
    Application Outbound/Inbound Internet Access
    Application Lifecycle ManagementConfigure application lifecycle management
    Log Collection Service
    Persistent StorageConfigure NAS storage
    Configuration ManagementInject configurations

    Other programming languages

    Advanced settingReferences
    Startup Command SettingsConfigure a startup command
    Environment Variable SettingsConfigure environment variables
    Application MonitoringEnable or disable application monitoring for an application
    Hosts Binding SettingsConfigure host bindings
    Application Health CheckConfigure application health checks
    Application Lifecycle ManagementConfigure application lifecycle management
    Application Outbound/Inbound Internet Access
    Log Collection Service
    Persistent StorageConfigure NAS storage
    Configuration ManagementInject configurations
  7. After you configure the settings, click Confirm.
  8. Use one of the following methods to check whether the configurations have taken effect.
    • Method 1: On the Change Records page, view the change details and release status of the application. If all batches are executed, the application is upgraded.
    • Method 2: On the Basic Information page, click the Instance Deployment Information tab to view the status of the instances. If Running is displayed in the Status column and the versions of the instances are changed to V2, the application is deployed.

Roll back an application

If one or more instances have not been upgraded when you use the canary release or phased release method to upgrade the instances of an application, the upgrade status of the application is Executing.

If no response is returned for the first release batch of application instances due to an exception, click Roll Back Now on the Change Details page to roll back the upgraded instances to the previous version and restore the application configurations to the original configurations before the upgrade.

If an application fails to be upgraded because an exception occurs (for example, a deployment package is unavailable or a health check fails) during an application change process, SAE stops the application and rolls back the application.

The application upgrade process in SAE requires approximately 30 minutes to complete. If an upgrade times out, SAE reports a timeout exception and stops the change process. In this case, you must manually terminate the release process and roll back the application on the Change Details page.

References

The following table describes the operations that you can perform on an application after you deploy the application on SAE.
OperationReferences
Lifecycle management operations, such as updating, starting, stopping, and deleting an application, and scaling in or scaling out the instances for an applicationManage the lifecycle of an application
Performance optimization operations, such as configuring auto scaling policies for an application, binding Server Load Balancer (SLB) instances to an application, and starting or stopping applications in batches
Application status-based operations, such as managing logs, configuring monitoring settings, viewing application events, and viewing change records