A primary/secondary server group consists of a primary server and a secondary server. After you select a primary/secondary server group for a listener, requests are forwarded to the primary server when the primary server works as expected. If the primary server fails, requests are forwarded to the secondary server. The time when the system switches to the secondary server is determined by the timeout period set for health checks. Requests are automatically forwarded to the primary server when it recovers.

Notice Only TCP and UDP listeners support primary/secondary server groups.

Prerequisite

Create a primary/secondary server group

  1. Log on to the CLB console.
  2. In the top navigation bar, select the region where the CLB instance is deployed.
  3. On the Instances page, click the ID of the CLB instance that you want to manage.
  4. Click the Primary/Secondary Server Groups tab.
  5. On the Primary/Secondary Server Groups tab, click Create Primary/Secondary Server Group.
  6. On the Create Primary/Secondary Server Group page, set the parameters.
    1. In the Primary/Secondary Server Group Name field, enter a name for the primary/secondary server group.
    2. Click Add and select a server in the Servers panel. Click Next.
      Note
    3. On the Configure Ports and Weights wizard page, specify the ports and weights of the server and click Add.
      You can click Add Port in the Actions column to add more ports.
  7. On the Create Primary/Secondary Server Group page, select an ECS instance in the Type column as the primary server.
  8. Click Create. In the message that appears, click OK.

    After you create a primary/secondary server group, you can also perform the following operations:

    • Add a TCP listener, and select the primary/secondary server group. For more information, see Add a TCP listener.
    • Add a UDP listener, and select the primary/secondary server group. For more information, see Add a UDP listener.

Delete a primary/secondary server group

If you no longer use a primary/secondary server group, you can delete the primary/secondary server group. Before you delete a primary/secondary server group, you must disassociate the server group from all listeners.

  1. Log on to the CLB console.
  2. In the top navigation bar, select the region where the CLB instance is deployed.
  3. On the Instances page, click the ID of the CLB instance that you want to manage.
  4. Click the Primary/Secondary Server Groups tab.
  5. On the Primary/Secondary Server Groups tab, find the primary/secondary server group that you want to delete and click Delete in the Actions column.
  6. In the message that appears, click OK.