Network Load Balancer Backend Servers

Creating a Network Load Balancer Backend

You must create backend servers (compute instances) for an existing network load balancer. The backend is one of a group of servers in a backend set to which network traffic is load balanced. You can create backends after you create the backend set, or at the same time. This topic creates only the backend.

Using the Compute Web UI

  1. Open the Navigation Menu. Under Networking, click Network Load Balancers.

  2. Click the name of the Network Load Balancer for which you want to create the network load balancer backend.

  3. Click Backendset under Resources.
  4. Any existing backends are listed, otherwise the list says No data available. To create a backend server, click on the hyperlink of the BackendSet to add the backend.
  5. Click Create Backend.
  6. Select the way you are adding backends. Possible values are:
    • Computed Instances Backends are added by instance.
    • IP Addresses Backends are added by IP address.
  7. For Computed Instances:

    • Instance: Enter the name of the backend.

    • Port: Enter 22 (TCP).

    • Name: Leave blank to take the default (ipaddress:port#).
    • Weight: Enter a weight in the range 1 to 100.
    • Security Rules: Select the security rules of the backend. Possible values are:
      • Configure Manually You manually configure security rules for the backend.
      • Configure Automatically The system automatically configures security rules for the backend.
  8. For IP Addresses:

    • IP Address: Enter the IP address of the backend.

    • Port: Enter the port number.

    • Name: Enter the name of the backend.
    • Weight: Enter a weight in the range 1 to 100.
  9. Click the Submit button in the dialog. To display the details of the new backend, view the backend.

Using the OCI CLI

  1. Gather the information you need to run the command:

    • Compartment OCID (oci iam compartment list --compartment-id-in-subtree true)

    • NLB OCID (oci nlb load-balancer list --compartment-id compartment_OCID)

  2. Run the backend create command.

    Use the NLB OCID and backend set name to create the backend set for the LB in the specified compartment.

    Note:

    For information about optional parameters, run the command with the --help option.

    Syntax (entered on a single line):

    oci nlb backend create --backend-set-name [backend-set-name] --ip-address [text]\ 
      --network-load-balancer-id [network-load-balancer_OCID] \ 
      --port [port-number-integer]  

    Where:

    backend-set-name is the name specific to the backend set where the backend is to be added.

    ip-address is the IP address for the backend to be added.

    network-load-balancer_OCID is the OCID of the load balancer associated with the backend set and servers.

    port-number-integer is the port number associated with the backend.

    Example:

    oci nlb backend create --backend-set-name PrivTCP_NLB1BESet \ 
      --ip-address 10.10.1.13 \
      --network-load-balancer-id ocid1.networkloadbalancer..….….uniqueID \ 
      --port 22
    
    {
      "opc-work-request-id": "ocid1.workrequest.....….….….uniqueID "
    }

    Note:

    The command returns a work request ID. To see the backend set results, you must list backends associated with the specified NLB and verify that the backend created is listed. Use the oci nlb backend list command to view the backend details.
    oci nlb backend list --network-load-balancer-id ocid1.networkloadbalancer.....….….….uniqueID  
    
    {
      "data": {
        "items": [
        {
          "ip-address": "10.10.1.13",
          "is-backup": false,
          "is-drain": false,
          "is-offline": false,
          "name": "10.10.1.13:22",
          "port": 22,
          "target-id": "ocid",
          "weight": 1
          },
          {
          "ip-address": "10.10.1.14",    
          "is-backup": false,
          "is-drain": false,
          "is-offline": false,
          "name": "10.10.1.14:22",
          "port": 22,
          "target-id": "ocid",
          "weight": 3
          },
        ]
      }
    }

Viewing a Network Load Balancer Backend Details

You can view a list of the backends in an existing network load balancer backend set and view their details.

Using the Compute Web UI

  1. Open the Navigation Menu. Under Networking, click Network Load Balancers.

  2. Click the name of the network load balancer (NLB) to which you want to list existing backends.

  3. Under Resources, click the name of the existing Backend Set to view its details, such as IP address, port, and weight.

Using the OCI CLI

  1. Gather the information you need to run the command:

    • Compartment OCID (oci iam compartment list --compartment-id-in-subtree true)

    • NLB OCID (oci nlb network-load-balancer list --compartment-id compartment_OCID)

  2. Run the list command.

    Use the NLB OCID and backend set name to list the backend details for the backend set.

    Note:

    For information about optional parameters, run the command with the --help option.

    Syntax (entered on a single line):

    oci nlb backend list --backend-set-name backend-set-name \
    --load-balancer-id network-load-balancer_OCID 

    Where:

    backend-set-name is the name specific to the backend set where the backends are located.

    network-load-balancer_OCID is the OCID of the load balancer associated with the backends.

    Example:

    $ oci nlb backend list --backend-set-name PrivLB1_BckEndSet  \
    --load-balancer-id ocid1.loadbalancer....….….….uniqueID
    
    {
      "data": {
        "items": [
        {
          "ip-address": "10.10.1.13",
          "is-backup": false,
          "is-drain": false,
          "is-offline": false,
          "name": "10.10.1.13:22",
          "port": 22,
          "target-id": "ocid",
          "weight": 1
        },
        {
          "ip-address": "10.10.1.14",
          "is-backup": false,
          "is-drain": false,
          "is-offline": false,
          "name": "10.10.1.14:22",
          "port": 22,
          "target-id": "ocid",
          "weight": 3
        },
        {
          "ip-address": "10.10.1.2",
          "is-backup": false,
          "is-drain": false,
          "is-offline": false,
          "name": "10.10.1.2:22",
          "port": 22,
          "target-id": "ocid",
          "weight": 1
        },
        {
          "ip-address": "10.10.1.3",
          "is-backup": false,
          "is-drain": false,
          "is-offline": false,
          "name": "10.10.1.3:22",
          "port": 22,
          "target-id": "ocid",
          "weight": 1
        }
        ]
      }
    }

Editing a Network Load Balancer Backend

You can change some properties of a network load balancer (NLB) backend that's a member of a backend set.

Using the Compute Web UI

  1. Open the Navigation Menu. Under Networking, click Network Load Balancers.

  2. Click the name of the network load balancer for which you want to edit backend properties.
  3. Under Resources, click Backend Sets.
  4. Click the name of the Backend Set with the backend that you want to edit.
  5. Select the name of the NLB backend that you want to edit.

  6. In the Actions list, click Edit to open the Edit Network Load Balancer Backend window.

  7. Make allowable changes in the pop-up window.

  8. Click Update Network Load Balancer Backend to update the NLB backend properties.

Using the OCI CLI

  1. Gather the information you need to run the command:

    • Compartment OCID (oci iam compartment list --compartment-id-in-subtree true)

    • NLB OCID (oci nlb network-load-balancer list --compartment-id compartment_OCID)

  2. Run the update command, which returns a work request ID.

    Note:

    For information about optional parameters, run the command with the --help option.

    Syntax (entered on a single line):

    oci nlb backend update --backend-name backend-name \ 
    --backend-set-name backend-set-name \
    --network-load-balancer-id networkloadbalancer_OCID [PARAMETERS TO CHANGE]

    Note:

    The is-drain, is-offline, and is-backup parameters are ignored, but must be set to false.

    Where:

    backend-name is the name of the backend associated with the backend set being edited.

    backend-set-name is the name of the backend set associated with the backend being edited.

    networkloadbalancer_OCID is the OCID of the load balancer associated with the backend set and backend.

    Options:

    max-wait-seconds The maximum time to wait for the work request to reach the state defined by wait-for-state. Defaults to 1200 seconds.

    wait-for-state This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Accepted values are: ACCEPTED, CANCELED, CANCELING, FAILED, IN_PROGRESS, SUCCEEDED.

    wait-interval-seconds Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.

    weight The network load balancing policy weight assigned to the backend. Backend servers with a higher weight receive a larger proportion of incoming traffic.

    Example (change the backend weight to 3):

    $ oci nlb backend update --backend-name 10.0.0.3:8080 --backend-set-name example-backend-set \
      --network-load-balancer-id ocid1.networkloadbalancer....….….….uniqueID \
      --weight 3 
    
    { 
      "opc-work-request-id": "ocid1.workrequest.xxx....….….….uniqueID"
    }

    Note:

    To see the backend update results, use the backend get command for that backend.
    $ oci nlb backend get --backend-name 172.16.0.151:22 --backend-set-name example_backend_set \
    --network-load-balancer-id ocid1.networkloadbalancer....….….….uniqueID 
    
    {
      "data": {
        "ip-address": "172.16.0.151:222",
        "is-backup": false,
        "is-drain": false,
        "is-offline": false,
        "name": "172.16.0.151:222",
        "port": 22,
        "target-id": "ocid",
        "weight": 3
      },
    }

Deleting a Network Load Balancer Backend

You can delete a network load balancer (NLB) Backend from a Backend Set and remove it from service.

Using the Compute Web UI

  1. Open the Navigation Menu. Under Networking, click Network Load Balancers.

  2. Click the name of the network load balancer for which you want to delete the backend server.
  3. Under Resources, click Backend Sets.
  4. Click the name of the Backend Set that contains the backend you want to delete in order to view the backend set details.
  5. Select the name of the backend you want to delete.

  6. Under the Actions column, click the three-dots pull-down menu, and select Delete.

  7. Confirm the operation when prompted.

Using the OCI CLI

  1. Gather the information you need to run the command:

    • Compartment OCID (oci iam compartment list --compartment-id-in-subtree true)

    • NLB OCID (oci nlb network-load-balancer list --compartment-id compartment_OCID)

  2. Run the nlb backend delete command.

    Syntax (entered on a single line):

    $ oci nlb backend delete --backend-name backend-name --backend-set-name backend-set-name \
    --network-load-balancer-id network-load-balancer_OCID

    Note:

    To delete the NLB backend server without verification, run the command with the --force option.

    Where:

    backend-name is the name of the backend associated with the backend set.

    backend-set-name is the name of the backend set associated with the backend being deleted.

    network-load-balancer_OCID is the OCID of the network load balancer associated with the backend set and backend.

    Example:

    $ oci nlb backend delete --backend-name 172.16.0.154:80 --backend-set-name PubLB1_BckEndSet \
    --network-load-balancer-id ocid1.networkloadbalancer....….….….uniqueID
    Are you sure you want to delete this resource? [y/N]: y