This topic describes how to create a primary/secondary server group and then add Elastic Compute Service (ECS) instances to the primary/secondary server group. A primary/secondary server group contains a primary server and a secondary server that can fail over to prevent service interruption. By default, the primary server handles all requests that are distributed by the SLB instance. When the primary server fails, requests are redirected to the secondary server.
- A Server Load Balancer (SLB) instance is created. For more information, see Create an SLB instance.
- ECS instances are created and applications are deployed on the ECS instances to process requests.
- Log on to the Server Load Balancer console.
- On the Instances page, select the region of the SLB instance that you want to manage.
- Find the 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 panel, select the ECS instances that you want to add. You can add only two ECS instances to a primary/secondary server group.
- Click Next.
- On the Configure Ports and Weights wizard page, specify the backend ports that you want to open on the ECS instances
to receive requests. If you want to open more than one port on an ECS instance, click
Add Port in the Actions column. You can open the same port on different backend servers that are connected to the same SLB instance.
- Click Add.
- On the Create Primary/Secondary Server Group page, select an ECS instance in the Type column as the primary server.
- Click Create.