This topic describes how to create a primary/secondary server group and then add ECS instances to the primary/secondary server group. You can use a primary/secondary server group to implement failover between a primary server and a secondary server. By default, the primary server handles all distributed requests. When the primary server fails, traffic is redirected to the secondary server.

Prerequisites

Before you create a primary/secondary server group, make sure that the following conditions are met:
  • An SLB instance is created. For more information, see Create an SLB instance.
  • You have created ECS instances and deployed applications on these ECS instances to process requests.

Procedure

  1. Log on to the Server Load Balancer console.
  2. On the Server Load Balancers page, select the region of the target SLB instance.
  3. Find the target SLB instance and click its instance ID.
  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, configure the primary/secondary server group.
    1. In the Primary/Secondary Server Group Name field, enter a name for the primary/secondary server group.
    2. Click Add. In the My Servers dialog box, select ECS instances that you want to add in the Select Servers step.
      You can add up to two ECS instances to a primary/secondary server group.
    3. Click Next.
    4. Configure the backend ports opened on ECS instances to receive requests, and then click Add.
      You can set multiple ports for an ECS instance.
    5. Set an ECS instance as the primary server.
    6. Click Create.