All Products
Search
Document Center

Realtime Compute for Apache Flink:Cross-zone high availability

Last Updated:Feb 24, 2025

The cross-zone high availability feature can effectively prevent service interruptions caused by faults in a single zone and ensure service stability. This feature is used to support high availability in different zones of the same region. Realtime Compute for Apache Flink allows you to implement the cross-zone high availability feature for subscription namespaces that use cross-zone compute units (CUs). This topic describes how to use the cross-zone high availability feature and stop the billing for cross-zone CUs.

Feature description

You can configure two types of CUs for a Realtime Compute for Apache Flink workspace: single-zone CUs and cross-zone CUs. You can create single-zone namespaces or cross-zone namespaces based on the selected CU type:

  • Single-zone namespaces: Realtime Compute for Apache Flink allocates resources to an optimal computing zone in the selected region. Zones in the same region can communicate with each other over an internal network. The computing layer performs transparent scheduling across the zones to allow the resources to be shared within the region. This enhances resource elasticity.

  • Cross-zone namespaces: The cross-zone high availability feature can be implemented. If the primary zone fails, deployments will automatically fail over to the secondary zone. This helps prevent service interruptions from failures in a single zone, ensuring service continuity and high availability.

image

Usage notes

  • To implement full-link high availability, you must ensure that your upstream and downstream systems are highly available.

  • A latency of milliseconds may occur when Realtime Compute for Apache Flink accesses external upstream and downstream resources across zones. The service-level agreement (SLA) guarantees the network latency across zones to be less than 3 milliseconds. For more information, see Average Latency among Zones. In most cases, the latency for accessing upstream and downstream resources except for Tair (Redis OSS-compatible) is acceptable. We recommend that you evaluate the latency based on your business requirements to determine whether to enable the cross-zone high availability feature.

Regions and billing

You can purchase cross-zone CUs only for subscription workspaces that use Intel x86. The price of cross-zone CUs is higher than single-zone CUs. For information about the supported regions and billing, see Subscription.

If your workspace uses the pay-as-you-go billing method, you can change the billing method to subscription and use the cross-zone high availability feature by referring to Method 2 and Method 3 in this topic.

Note

The billing method of cross-zone workspaces cannot be changed to pay-as-you-go.

Enable and use the cross-zone high availability feature

Method 1: Use the cross-zone namespace that is automatically created when you purchase a workspace

  1. A cross-zone namespace is automatically when you purchase a Realtime Compute for Apache Flink workspace.

    Purchase a workspace that uses the subscription billing method and the Intel x86 architecture processor. Set the Deployment model parameter to Cross zone, specify the Resource Quota parameter for the cross-zone CUs in the CU Info section, and then select two vSwitches from different zones. For more information, see Activate Realtime Compute for Apache Flink.

    After you create the workspace, a cross-zone namespace named Workspace name-default-ha is generated by default.

  2. Click the name of the desired cross-zone namespace in your workspace. Create a draft and run the deployment for the draft in the cross-zone namespace.

    image

Method 2: Add cross-zone CUs and manually create and use a cross-zone namespace

If you do not set the Deployment model parameter to Cross zone when you purchase a workspace, you can add cross-zone CUs and create and use a cross-zone namespace.

  1. Add cross-zone CUs.

    1. Find the desired workspace and choose More > Reconfigure Workspace Resources in the Actions column.

    2. In the Reconfigure Workspace Resources dialog box, click Add CU Type.

    3. Enter a value in the Target CU column for the cross-zone CU type and select a vSwitch.

      Only vSwitches created in your VPC and zones supported by Realtime Compute for Apache Flink can be selected. If no available vSwitch is displayed, you can create a vSwitch. For more information, see Create a vSwitch.

      Important

      After you add cross-zone CUs in the workspace, make sure that the CIDR block of the new vSwitch in the zone is added to the whitelist of the upstream and downstream systems. This prevents issues caused by network access failures.

      image

    4. Read the terms of service, select the check box to confirm that you have read the terms of service, and then click OK to complete the payment.

  2. Create a cross-zone namespace. For more information, see Create a namespace.

  3. Create and run a deployment in the namespace that uses cross-zone CUs. For more information about how to go to the namespace, see Create a namespace.

Method 3: Enable the cross-zone high availability feature for a single-zone namespace

  1. Log on to the Realtime Compute for Apache Flink console.

  2. Make sure that the number of unallocated cross-zone CUs in the current workspace is greater than or equal to the number of allocated CUs in the namespace for which you want to enable cross-zone high availability.

    If the number of unallocated cross-zone CUs in the workspace is less than the number of allocated CUs in the namespace, you can add cross-zone CUs for the workspace. You can also click Reconfigure Resources in the Actions column of a cross-zone namespace and change the value in the Resource Reconfiguration (CUs) column to release cross-zone CUs. For more information about how to reconfigure resources, see Reconfigure resources.

  3. Find the desired namespace and click Turn on high availability in the Actions column. In the dialog box that appears, click OK.

    image

    After you click OK, Realtime Compute for Apache Flink automatically allocates cross-zone CUs to the namespace and returns the original single-zone CUs to the workspace as unallocated CUs. The number of allocated cross-zone CUs is equal to the number of the original single-zone CUs. Example:

    • Before you enable the cross-zone high availability feature: In a workspace, the number of purchased single-zone CUs is 5, the number of allocated single-zone CUs is 2, the number of purchased cross-zone CUs is 5, and the number of allocated cross-zone CUs is 0.

    • After you enable the cross-zone high availability feature: In the workspace, the number of purchased single-zone CUs is 5, the number of allocated single-zone CUs is 0, the number of purchased cross-zone CUs is 5, and the number of allocated cross-zone CUs is 2.

  4. Create and run a deployment in the namespace. For more information, see Go to a namespace.

Disable the cross-zone high availability feature for a namespace

You can perform the following operations to disable the cross-zone high availability feature for a namespace that you create by using one of the preceding methods. After you disable the cross-zone high availability feature, billing for cross-zone CUs does not stop. For more information about how to stop billing for cross-zone CUs, see the Unsubscribe from cross-zone CUs section of this topic.

  1. Log on to the Realtime Compute for Apache Flink console.

  2. Check that the number of unallocated single-zone CUs in the current workspace is greater than or equal to the number of allocated CUs in the current namespace that uses cross-zone CUs.

    If the number of unallocated single-zone CUs in the workspace is less than the number of allocated CUs in the namespace, you can add single-zone CUs for the workspace. You can also click Reconfigure Resources in the Actions column of a single-zone namespace and change the value in the Resource Reconfiguration (CUs) column to release single-zone CUs. For more information about how to reconfigure resources, see Reconfigure resources.

  3. Find the desired namespace and click Turn off high availability in the Actions column. In the dialog box that appears, click OK.

    After you disable the cross-zone high availability feature, the resource change policies are the same as those when you enable the cross-zone high availability feature. After the feature is completely disabled, you can use the namespace as expected.

Unsubscribe from cross-zone CUs

If the number of allocated cross-zone CUs in a workspace is 0, you are not charged for cross-zone CUs. To unsubscribe from cross-zone CUs, perform the following steps:

  1. Log on to the Realtime Compute for Apache Flink console.

  2. Make sure that the cross-zone high availability feature is disabled for all namespaces of the workspace.

    For more information, see the Disable the cross-zone high availability feature for a namespace section of this topic.

  3. Change the value in the Target CU column for the cross-zone CU type of the workspace to 0.

    1. Find the desired workspace and choose More > Reconfigure Workspace Resources in the Actions column.

    2. In the Reconfigure Workspace Resources dialog box, change the value in the Target CU column for the cross-zone CU type of the workspace to 0.

    3. Read the terms of service, select the check box to confirm that you have read the terms of service, and then click OK to complete the payment.

References