Backend Server Management

When you create a Load Balancer resource, you must specify the backend servers (Compute instances ) to include in each backend set . The load balancer routes incoming traffic to these backend servers based on the policies you specified for the backend set. You can use the Console to add and remove backend servers in a backend set.

To route traffic to a backend server, the Load Balancing service requires the IP address of the compute instance and the relevant application port. If the backend server resides within the same VCN as the load balancer, Oracle recommends that you specify the compute instance's private IP address. If the backend server resides within a different VCN, you must specify the public IP address of the compute instance. You also must ensure that the VCN's security rules allow Internet traffic.

Important

When you add backend servers to a backend set, you specify either the instance OCID or an IP address for the server to add. An instance with multiple VNICs attached can have multiple IP addresses pointing to it.

  • If you identify a backend server by OCID, Load Balancing uses the primary VNIC's primary private IP address.

  • If you identify the backend servers to add to a backend set by their IP addresses, it is possible to point to the same instance more than once.

To enable backend traffic, your backend server subnets must have appropriate ingress and egress security rules. When you add backend servers to a backend set, you can specify the applicable network security groups (NSGs). If you prefer to use security lists for your VCN, the Load Balancing service Console can suggest security list rules for you. You also can configure them yourself through the Networking service. See Security Lists for more information.

Note

To accommodate high-volume traffic, Oracle strongly recommends that you use stateless security rules for your load balancer subnets. See Stateful Versus Stateless Rules for more information.

You can add and remove backend servers without disrupting traffic.

Adding Backend Servers

Add a backend server to a backend set for a Load Balancer resource.

Note

If the load balancer has no backend sets, you must create one before you can specify a backend server. See Creating Backend Sets for more information.

Use one of the following methods to add a backend server to a backend set for a selected load balancer.

To add a backend server using the Console

Use the OCI Console to add a backend server to a backend set for a Load Balancer resource.

  1. Open the navigation menu, click Networking, and then click Load Balancers.

  2. Select the Compartment from the list.

    All load balancers and network load balancers in that compartment are listed in tabular form.

  3. (optional) Select a State from the list to limit the load balancers displayed to that state.

  4. (optional) Uncheck Network Load Balancer under Type to only display load balancers.

  5. Click the load balancer whose backend set you want to delete.

    The Load Balancer Details page appears.

  6. Click Backend Sets under Resources.

    The Backend Sets list appears. All backend sets are listed in tabular form.

  7. Click the name of the backend set to which you want to add one or more backend servers.

    The Backend Set Details page appears.

  8. Click Backends under Resources.

    The Backends list appears. All backend servers are listed in tabular form.

  9. Click Add Backends.

    The Add Backends dialog box appears.

    Tip

    You cannot add a backend server marked as Backup to a backend set that uses the IP Hash policy.

  10. Choose how to add backend servers: Specify how you want to add backend servers to the backend set:

    • Compute Instances: Choose this option to select from a list of available Compute instances.

      • Instances in <compartment>: Select (check) the instances you want to include in the backend set.

        To select instances from a different compartment, use the Change Compartment link and choose a compartment from the list.

        Tip

        You can choose instances from one compartment at a time. After you add instances from one compartment, you must repeat the Add Backends process to add instances from another compartment.

        After you select an instance to add to the backend set, you can specify:

        • Port: Required. The backend server port to which the load balancer must direct traffic.

        • Weight: The load balancing weight assigned to the server. For more information, see Load Balancing Policies.

      • Choose to manually configure subnet security list rules that allow the intended traffic or let the Load Balancing service create security list rules for you. To learn more about these rules, see Parts of a Security Rule.

        • Manually configure security list rules after the load balancer is created: When you choose this option, you must create your own rules after adding the backend servers.

        • Automatically add security list rules: When you choose this option, the Load Balancing service creates security list rules for you.

          The system displays a table for egress rules and a table for ingress rules. Each table lets you choose the security list that applies to the relevant subnet. You can then choose whether to apply the proposed rules for each affected subnet.

    • IP Addresses: Choose this option to enter the IP addresses of the backend servers (Compute instances) to add.

      • IP Address: Required. Specify the IP address of a backend server you want to add to the backend set.

      • Port: Required. Specify the server port to which the load balancer must direct traffic.

      • Weight: Required. Specify the load balancing weight to apply to this server. For more information, see Load Balancing Policies.

      You can click the plus + icon to add another server to the list or click the X icon to remove a list item.

  11. Click Add.

To add a backend server using the CLI

Use the command line interface (CLI) to add a backend server to a backend set for a Load Balancer resource.

Enter the following command:

oci lb backend create --backend-set-name backend_set_name --load-balancer-id load_balancer_id --ip-address ip_address --port port [OPTIONS]

See the CLI online help for a list of options:

oci lb backend create --help

See oci lb backend create for a complete description of the command.

To add a backend server using the API

Use the API to add a backend server to a backend set for a Load Balancer resource.

Run the CreateBackend method to add a backend server to a backend set for a load balancer. See CreateBackend for a complete description.

Listing Backend Servers

List the backend servers contained within a backend set for a Load Balancer resource.

Use one of the following methods to display a list of backend servers contained within a backend set for a selected load balancer.

To list the backend servers using the Console

Use the OCI Console to list the backend servers contained within a backend set for a Load Balancer resource.

  1. Open the navigation menu, click Networking, and then click Load Balancers.

  2. Select the Compartment from the list.

    All load balancers and network load balancers in that compartment are listed in tabular form.

  3. (optional) Select a State from the list to limit the load balancers displayed to that state.

  4. (optional) Uncheck Load Balancer under Type to only display load balancers.

  5. Select the load balancer containing the backend servers that you want to list.

    The Load Balancer Details dialog box appears.

  6. Click Backend Sets under Resources.

    The Backend Sets list appears. All backend sets are listed in tabular form.

  7. Click the backend set whose backend servers you want to list.

    The Backend Set Details dialog box appears.

  8. Click Backends under Resources.

    The Backends list appears. All backend servers are listed in tabular form.

To list the backend servers using the CLI

Use the command line interface (CLI) to list the backend servers contained within a backend set for a Load Balancer resource.

Enter the following command:

oci lb backend list --backend-set-name backend_set_name --load-balancer-id load_balancer_id [OPTIONS]

See the CLI online help for a list of options:

oci lb backend list --help

See oci lb backend list for a complete description of the command.

To list the backend servers using the API

Use the API to list the backend servers contained within a backend set for a Load Balancer resource.

Run the ListBackends method to display a list of backend servers for a backend set for a load balancer. See ListBackends for a complete description.

Getting Backend Server Details

Get the details of a backend server contained within a backend set for a Load Balancer resource.

Use one of the following methods to display the details of a backend server contained within a backend set for a selected load balancer.

To get the details of a backend server using the Console

Use the OCI Console to get the details of a backend server contained within a backend set for a Load Balancer resource.

  1. Open the navigation menu, click Networking, and then click Load Balancers.

  2. Select the Compartment from the list.

    All load balancers and network load balancers in that compartment are listed in tabular form.

  3. (optional) Select a State from the list to limit the load balancers displayed to that state.

  4. (optional) Uncheck Load Balancer under Type to only display load balancers.

  5. Select the load balancer containing the backend servers that you want to list.

    The Load Balancer Details dialog box appears.

  6. Click Backend Sets under Resources.

    The Backend Sets list appears. All backend sets are listed in tabular form.

  7. Click the backend set whose details you want to get.

    The Backend Set Details dialog box appears.

  8. Click Backends under Resources.

    The Backends list appears. All backend servers are listed in tabular form.

To get the details of a backend server using the CLI

Use the command line interface (CLI) to get the details of a backend server contained within a backend set for a Load Balancer resource.

Enter the following command:

oci lb backend get --backend-name backend_name --backend-set-name backend_set_name --load-balancer-id load_balancer_id [OPTIONS]

See the CLI online help for a list of options:

oci lb backend get --help

See oci lb backend get for a complete description of the command.

To get the details of a backend server using the API

Use the API to get the details of a backend server contained within a backend set for a Load Balancer resource.

Run the GetBackend method to get the details of a backend contained within a backend set for a load balancer. See GetBackend for a complete description.

Editing Backend Servers

Update a backend server contained within a backend set for a Load Balancer resource.

Use one of the following methods to edit and update the settings of a backend server contained within a backend set for a selected load balancer.

To edit a backend server using the Console

Use the OCI Console to update a backend server contained within a backend set for a Load Balancer resource.

  1. Open the navigation menu, click Networking, and then click Load Balancers.

  2. Select the Compartment from the list.

    All load balancers and network load balancers in that compartment are listed in tabular form.

  3. (optional) Select a State from the list to limit the load balancers displayed to that state.

  4. (optional) Uncheck Load Balancer under Type to only display load balancers.

  5. Select the load balancer containing the backend server that you want to edit.

    The Load Balancer Details dialog box appears.

  6. Click Backend Sets under Resources.

    The Backend Sets list appears. All backend sets are listed in tabular form.

  7. Click the backend set whose backend server you want to edit.

    The Backend Set Details dialog box appears.

  8. Click Backends under Resources.

    The Backends list appears. All backend servers are listed in tabular form.

  9. Select (check) the row corresponding to the backend server you want to edit.

  10. Choose an action from the Actions button list. The available actions include:

    • Edit: Opens a single dialog box in which you can edit the port, weight, drain, offline, and backup settings.

    • Edit Port: Opens a dialog box in which you can change the application port setting.

    • Edit Weight: Opens a dialog box in which you can change the load balancing weight.

    • Edit Drain State: Opens a dialog box in which you can change the drain state.

      If you set the server's drain status to true, the load balancer stops forwarding new TCP connections and new non-sticky HTTP requests to this backend server. This setting allows an administrator to take the server out of rotation for maintenance purposes.

    • Edit Offline State: Opens a dialog box in which you can change the offline status.

      If you set the server's offline status to true, the load balance forwards no ingress traffic to this backend server.

    • Edit Backup State: Opens a dialog box in which you can change the backup status.

      If you set the server's backup status to true, the load balancer forwards ingress traffic to this backend server only when all other backend servers not marked as backup fail the health check policy. This configuration is useful for handling disaster recovery scenarios.

      Note

      Backend servers marked as Backup are not compatible with a load balancer that uses the IP Hash policy.

    • Delete: Removes the server from the backend set.

    Tip

    You can select multiple servers to apply the same action to each one.

  11. Click Save Changes.

To edit a backend server using the CLI

Use the command line interface (CLI) to update a backend server contained within a backend set for a Load Balancer resource.

Enter the following command:

oci lb backend update --backend-name backend_name --backend-set-name backend_set_name --load-balancer-id load_balancer_id --backup [true|false] --drain [true|false] --offline [true|false] --weight weight [OPTIONS]

The backup parameter indicates whether (true) or not (false) the load balancer treats this server as a backup unit. If the value is true, the load balancer forwards no ingress traffic to this backend server unless all other backend servers not marked as "backup" fail the health check policy. You cannot add a backend server marked as backup to a backend set that uses the IP Hash policy.

The drain parameter indicates whether (true) or not (false) the load balancer drains this backend server. If the value is true, the backend server receives no new incoming traffic.

The weight parameter indicates the load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger proportion of incoming traffic. For example, a server weighted '3' receives three times the number of new connections as a server weighted '1.' For more information on load balancing policies, see How Load Balancing Policies Work.

See the CLI online help for a list of options:

oci lb backend update --help

See oci lb backend get for a complete description of the command.

To edit a backend server using the API

Use the API to update a backend server contained within a backend set for a Load Balancer resource.

Run the UpdateBackend method to get the details of a backend contained within a backend set for a load balancer. See UpdateBackend for a complete description.

Deleting Backend Servers

Delete a backend server contained within a backend set for a Load Balancer resource.

Use one of the following methods to delete a backend server contained within a backend set for a selected load balancer.

To delete a backend server using the Console

Use the OCI Console to delete a backend server contained within a backend set for a Load Balancer resource.

  1. Open the navigation menu, click Networking, and then click Load Balancers.

  2. Select the Compartment from the list.

    All load balancers and network load balancers in that compartment are listed in tabular form.

  3. (optional) Select a State from the list to limit the load balancers displayed to that state.

  4. (optional) Uncheck Load Balancer under Type to only display load balancers.

  5. Select the load balancer containing the backend server that you want to delete.

    The Load Balancer Details dialog box appears.

  6. Click Backend Sets under Resources.

    The Backend Sets list appears. All backend sets are listed in tabular form.

  7. Select (check) the row corresponding to the backend server you want to edit.

  8. Click Actions and select Delete from the list.

    Tip

    You can select multiple servers to delete each one.

  9. Confirm the deletion when prompted.

To delete a backend server using the CLI

Use the command line interface (CLI) to delete a backend server contained within a backend set for a Load Balancer resource.

Enter the following command:

oci lb backend delete --backend-name backend_name --backend-set-name backend_set_name --load-balancer-id load_balancer_id [OPTIONS]

See the CLI online help for a list of options:

oci lb backend delete --help

See oci lb backend delete for a complete description of the command.

To delete a backend server using the API

Use the API to delete a backend server contained within a backend set for a Load Balancer resource.

Run the DeleteBackend method to delete a backend contained within a backend set for a load balancer. See DeleteBackend for a complete description.

Getting Backend Server Health Details

Get the health details of a backend server within a backend set for a Load Balancer resource.

The primary and standby load balancers both provide health check results that contribute to the health status.

The following table lists the health status indicators and their meanings.

Level

Color

Description

OK

Green

The primary and standby load balancer health checks both return a status of OK.

Warning

Yellow

One health check returned a status of OK and one did not.

Critical

Red

Neither health check returned a status of OK.

Unknown

Gray

One or both health checks returned a status of UNKNOWN or the system was unable to retrieve metrics.

Use one of the following methods to display the health details of a backend server contained within a backend set for a selected load balancer.

Getting Backend Server Health Details using the Console

Use the OCI Console to get the health details of a backend server within a backend set for a Load Balancer resource.

  1. Open the navigation menu, click Networking, and then click Load Balancers.

  2. Select the Compartment from the list.

    All load balancers and network load balancers in that compartment are listed in tabular form.

  3. (optional) Select a State from the list to limit the load balancers displayed to that state.

  4. (optional) Uncheck Load Balancer under Type to only display load balancers.

  5. Select the load balancer containing the backend servers that you want to list.

    The Load Balancer Details dialog box appears.

  6. Click Backend Sets under Resources.

    The Backend Sets list appears. All backend sets are listed in tabular form.

  7. Click the backend set whose details you want to get.

    The Backend Set Details dialog box appears.

  8. Click Backends under Resources.

    The Backends list appears. All backend servers are listed in tabular form.

  9. View the health status of the backend server under Health.

    See Health Status Indicators for descriptions of the load balancer health indicators.

Getting Backend Server Health Details using the CLI

Use the command line interface (CLI) to get the health details of a backend server within a backend set for a Load Balancer resource.

Enter the following command:

oci lb backend-health get --backend-name backend_name --backend-set-name backend_set_name --load-balancer-id load_balancer_id [OPTIONS]

See the CLI online help for a list of options:

oci lb backend-health get --help

See oci lb backend-health get for a complete description of the command.

Getting Backend Server Health Details using the API

Use the API to get the health details of a backend server within a backend set for a Load Balancer resource.

Run the GetBackendHealth method to get the health details a backend set for a load balancer. See GetBackendHealth for a complete description.

See Health Status Indicators for descriptions of the load balancer health indicators.