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.
- 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.
- Log on to the Server Load Balancer console.
- On the Server Load Balancers page, select the region of the target SLB instance.
- Find the target SLB instance and click its instance ID.
- Click the Primary/Secondary Server Groups tab.
- On the Primary/Secondary Server Groups tab, click Create Primary/Secondary Server Group.
- On the Create Primary/Secondary Server Group page, configure the primary/secondary server group.
- In the Primary/Secondary Server Group Name field, enter a name for the primary/secondary server group.
- 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.
- Click Next.
- Configure the backend ports opened on ECS instances to receive requests, and then
click Add. You can set multiple ports for an ECS instance.
- Set an ECS instance as the primary server.
- Click Create.