Create a Load Balancer for Managing SBC Servers

If you would like to deploy a High Availability architecture for SBC Servers, you need to create a load balancer to monitor and manage the target servers.

Background information

In a High Availability architecture, a load balancer is necessary. It monitors the health of the registered SBC Servers, and routes traffic only to the healthy servers, greatly improving the system performance and availability.

When creating a load balancer, you need to configure a target group and register at least one target, the load balancer will route traffic to the target group.

The following diagram shows the architecture of the SBC Cluster after you create a load balancer.

Prerequisites

You have created public subnets for SBC Servers in at least two Availability Zones.

Procedure

Create a target group

Before creating a load balancer, you must at least add one target group.
Note: We recommend that you create a temporary target group, and delete it after the load balancer is successfully created, as Yeastar will create new target group when installing servers in your VPC.
  1. Log in to Amazon EC2 Console.
  2. On the left navigation bar, go to Load Balancing > Target Groups, click Create target group.

  3. On the Specify group details page, complete the basic configurations.
    • Choose a target type: Select Instances.
    • Target group name: Enter a name for the target group to help you identify it. In this example, enter ycm-cloudpbx.
    • Protocol: In the drop-down list, select TCP.
    • Port: Set the port value. In this example, enter 23001.
      Note: Here the 23001 is just a test port, Yeastar will change the target group as needed when installing servers.
    • VPC: In the drop-down list, select the VPC that you've created for the Cloud PBX. In this example, select ycm-cloudpbx.
  4. Click Next to register targets.
  5. In the Available instances, select all the SBC Server instances, then click Include as pending below.

  6. Click Create target group.

    The new created target group is displayed in the Target groups list.

Create a load balancer

Now you can create a load balancer.

  1. Log in to Amazon EC2 Console.
  2. On the left navigation bar, go to Load Balancing > Load Balancer.
  3. On the top of the page, click Create Load Balancer.

  4. On Load balancer types page, select Network Load Balancer, click Create.

  5. In Basic configuration section, complete the following settings.

    • Load balancer name: Enter a name for the load balancer to help you identify it. In this example, enter sbc-nlb.
    • Scheme: Select Internet-facing.
    • IP address type: Select IPv4.
  6. In Network mapping section, complete the following settings:
    • VPC: In the drop-down list, select the VPC created for the Cloud PBX.
    • Mappings: Select at least TWO Availability Zones, then configure the related network mappings.

      • Subnet: In the drop-down list, select the subnet created for SBC Server.
      • IPv4 settings: Assign an Elastic IP address in each Availability Zone.
        Note: You can choose Use an Elastic IP address and then select an existing Elastic IP address, or let the Amazon AWS assign an IP address for your load balancer.
  7. In Listeners and routing section, set up the listener.

  8. Click Create load balancer.

Delete the target group

After you successfully create a load balancer, we recommend that you delete the temporary target group, as Yeastar will create the required target group later when installing servers in you VPC.

  1. Go to Load Balancing > Load Balancer, select the load balancer that you've created in the former procedure.

    The detailed information of the load balancer is displayed on the bottom of the page.

  2. Delete the listener of the load balancer.

    1. Under Listener tab, select the listener added when creating the load balancer, then click Delete.
    2. In the pop-up dialog box, click Yes, Delete.
  3. Go to Load Balancing > Target Groups, delete the temporary target group.
    1. Select the target group, then click Actions > Delete.

    2. In the pop-up dialog box, click Yes, delete.

    The target group is successfully deleted.