Help Center/ ROMA Connect/ User Guide/ Service Integration Guide/ Exposing an API/ (Optional) Creating a Load Balance Channel
Updated on 2023-02-28 GMT+08:00

(Optional) Creating a Load Balance Channel

This channel allows ROMA Connect to access backend services deployed on servers in load balancing mode (direct access to ECSs in the same VPC, or to ECSs in other VPCs and private servers by specifying IP addresses).

For example, six ECSs deployed in a VPC have a load balance channel to reach ECS 1 and ECS 4. ROMA Connect can access these two ECSs through the channel.

Prerequisites

  • The network between ROMA Connect and the servers in the load balance channel is working.
    • Same VPC: Let the instance directly access the servers.
    • Two VPCs in the same region: Connect the instance and the servers with a peering connection. For details, see VPC Peering Connection.
    • Two VPCs in two regions: Create a cloud connection and load the VPCs that need to communicate with each other. For details, see Network Communications Among VPCs Across Regions.
    • Communication over the public network: Ensure that the ROMA Connect instance has been bound with an EIP.
  • You have the VPC Administrator permission.

Procedure

  1. Log in to the ROMA Connect console. On the Instances page, click View Console of an instance.
  2. In the navigation pane on the left, choose API Connect > API Policies. On the Load Balance Channels tab, click Create Load Balance Channel.
  3. On the page displayed, configure the following parameters.
    Table 1 Load balance channel parameters

    Parameter

    Description

    Name

    Enter a load balance channel name. Using naming rules facilitates future search.

    Port

    Enter the access port number in the load balance channel.

    Routing Algorithm

    Select an algorithm for routing backend service requests. The channel determines the server to which the requests are to be sent by the algorithm.

  4. Configure servers.
    1. Select a mode for adding servers to the load balance channel. This mode cannot be changed once the channel is created.
      • Select cloud servers from the list.
      • Specify IP addresses of the servers.
    2. Click Create Server Group. In the dialog box displayed, configure the following parameters and click OK.

      Servers can be added to different groups.

      Table 2 Server group parameters

      Parameter

      Description

      Group Name

      Enter a server group name. Using naming rules facilitates future search.

      Weight

      Enter the weight of the server group. The larger weight, the more requests that can be forwarded to the servers in the group.

      Description

      Enter a brief description of the group.

    3. Add servers to the load balance channel.
      • Add cloud servers.
        1. Click Add Cloud Server.
        2. In the dialog box displayed, select a subnet, select the cloud servers to be added, and click OK.
        3. Configure the following parameters.
          Table 3 Cloud server parameters

          Parameter

          Description

          Standby Node

          After you enable this option, the backend server serves as a standby node. It works only when all non-standby nodes are faulty.

          Port

          Enter the access port number of the backend server.

          0: uses the port of the load balance channel.

          Server Status

          Specify whether to enable the server.

          When enabled: Requests are distributed to the server.

      • Add a backend server address.
        1. Click Add Backend Server Address.
        2. Configure the following parameters.
          Table 4 Backend server parameters

          Parameter

          Description

          Backend Server Address

          Enter the IP address of the backend server.

          Standby Node

          After you enable this option, the backend server serves as a standby node. It works only when all non-standby nodes are faulty.

          Port

          Enter the access port number of the backend server.

          0: uses the port of the load balance channel.

          Server Status

          Specify whether to enable the server.

          When enabled: Requests are distributed to the server.

  5. Configure the health check (enabled by default), or disable this parameter.

    Table 5 Health check parameters

    Parameter

    Description

    Protocol

    Select the protocol used for the health check.

    Options: TCP, HTTP, HTTPS

    Two-way Authentication

    Available for Protocol set to HTTPS.

    Specify whether to enable two-way authentication between ROMA Connect and backend servers.

    Path

    Mandatory for Protocol set to HTTP or HTTPS.

    Enter the health check URL.

    Method

    Mandatory for Protocol set to HTTP or HTTPS.

    Select the HTTP request method used for the health check.

    Options: GET or HEAD

    Check Port

    Destination port of the health check.

    Default: uses the port number configured for the load balance channel.

    Healthy Threshold

    Number of consecutive successful checks required for an ECS to be considered healthy. Example: If set to 2, ROMA Connect declares the ECS status to be healthy when the check is successful twice in a row.

    Unhealthy Threshold

    Number of consecutive failed checks required for an ECS to be considered unhealthy. Example: If set to 5, ROMA Connect declares the ECS status to be abnormal when the check fails five times in a row.

    Timeout (s)

    Response timeout of a health check, in seconds. If no response is received within this time, the health check fails.

    Interval (s)

    Interval between consecutive checks, in seconds.

    Status Codes

    Mandatory for Protocol set to HTTP or HTTPS.

    When the server returns a specified HTTP response code, the server considers the response to be successful.

    Supports multiple response codes.

  6. Click Finish.