Health Checks

A load balancer (LB) backend set health check is a test to confirm the availability of LB backend servers. A health check can be a request or a connection attempt. The LB applies the health check policy, based on a configured time interval, to monitor the backend server set. If a server fails the health check, then the LB takes the server temporarily out of the balancing rotation. If the server later passes a subsequent health check, then the LB returns the backend server to the balancing rotation.

The health status of the specified backend set server is reported by the primary and standby load balancers.

For general information about LBaaS, see the Oracle Private Cloud Appliance Concepts Guide.

Viewing Backend Set Health Check Parameters

You can view the parameters used by the backend set of an existing load balancer to check the health of the backend servers in the set.

Using the Compute Web UI

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

  2. Click the name of the load balancer for which you want to view existing load balancer backend set health status.

  3. Under Resources, click Backend Sets.

  4. Click the name of the Backend Set to view its health check details, such as OK or Critical, among others.

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)

    • LB OCID (oci lb load-balancer list --compartment-id compartment_OCID)

  2. Run the backend-set health get command.

    Use the LB OCID to list the details 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 lb backend-set-health get --backend-set-name backend-set-name-text \
      --load-balancer-id load-balancer_OCID [OPTIONS]

    Where:

    backend-set-name-text is the name of the backend set associated with the backend server for which to retrieve the health status. Example: example_backend_set

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

    Example:

    $ oci lb backend-set-health get --backend-set-name TCP_BckEndSet  \
      --load-balancer-id ocid1.loadbalancer....….….….uniqueID
    
    {
     "data": {
     "critical-state-backend-names": [],
     "status": "OK",
     "total-backend-count": 2,
     "unknown-state-backend-names": [],
     "warning-state-backend-names": []
     }
    }

Editing Backend Set Health Check Parameters

You can change load balancer backend set properties, such as the health check interval.

Using the Compute Web UI

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

  2. Click the name of the load balancer for which you want to list existing backend set health check parameters.

  3. Under Resources, click Backend Sets

  4. To edit the health check parameters of a backend set, you can:

    1. Click Edit under the Actions column (three dots) pull down menu.
    2. Click the backend set to view its details, then click Edit.
  5. Click Save to save the changes.

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)

    • LB OCID (oci lb load-balancer list --compartment-id compartment_OCID)

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

    Note:

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

    Syntax (entered on a single line):

    oci lb backend-set update --backend-set-name [name-of-backend-set]--backends [complex-type] \
     --health-checker-protocol [protocol-text] --load-balancer-id [loadbalancer_OCID] \ 
     --policy [policy-text] --force

    Example:

    $ oci lb backend-set update --backend-set-name TCP_BckEndSet --backends '[{"backup": false, "drain": \
      false, "ip-address": "192.168.1.5","name": "192.168.1.5:22","offline":false, "port": 22, "weight": \
      1},{"backup": false, "drain": false, "ip-address": "192.168.1.4","name": "192.168.1.7:22","offline": \
      false, "port": 22, "weight": 1}]' --health-checker-protocol TCP --load-balancer-id \
      ocid1.loadbalancer....….….….uniqueID --policy ROUND_ROBIN --health-checker-port 22 \
      --health-checker-response-body-regex ".*" --force
    
    {
      "opc-work-request-id": "ocid1.workrequest...loadbalancer....….….….uniqueID"
    }

Viewing Load Balancer Health Policy

You can view the policy used by the load balancer to check backend set health.

Using the Compute Web UI

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

  2. Click the name of the load balancer for which you want to list existing backend sets.

  3. Under Resources, click Backend Sets.

  4. To view the health check parameters of a backend set, you can:

    1. Click View Details under the Actions column (three dots) pull down menu.
    2. Click the backend set to view its details.
  5. Click Backend Set Configuration on the Backend-Set Details page under the backend-set name for which to you want to view the health policy.

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)

    • LB OCID (oci lb load-balancer list --compartment-id compartment_OCID)

  2. Run the health checker get command.

    Use the LB OCID to list the details 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 lb health-checker get --backend-set-name [backend-set-name-text] \
     --load-balancer-id load-balancer_OCID

    Example:

    $ oci lb health-checker get --backend-set-name BckEndSet \
      --load-balancer-id ocid1.loadbalancer.. . .unique-id
    
    {
      "data": {
        "interval-in-millis": 10000,
        "port": 22,
        "protocol": "TCP",
        "response-body-regex": "HEALTHY",
        "retries": 5,
        "return-code": 200,
        "timeout-in-millis": 3000,
        "url-path": "/Public"
      },
      "etag": "6ea1ea14-b3d5-11ed-94b2-0010e0dacbd0"
    }

Editing Load Balancer Health Check

You can change load balancer (LB) and backend server set health check properties, such as the health check interval.

Using the Compute Web UI

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

  2. Click the name of the load balancer for which you want to edit existing backend set health check parameters.

  3. Under Resources, click Backend Sets

  4. To edit the health check parameters of a backend set, you can:

    1. Click Edit under the Actions column (three dots) pull down menu.
    2. Click the backend set to view its details, then click Edit to make allowable changes.
  5. Click Save to save the changes.

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)

    • LB OCID (oci lb load-balancer list --compartment-id compartment_OCID)

  2. Run the update command.

    Note:

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

    Syntax (entered on a single line):

    oci lb health-checker update --backend-set-name [name-of-backend-set] \
     --interval-in-millis [integer-in-millis] \ 
     --load-balancer-id [loadbalancer_OCID] --port [port-integer] \
     --protocol [protocol-text] --response-body-regex [expression-text] \ 
     --retries [retries-integer] --return-code [rc-integer] \ 
     --timeout-in-millis [integer-in-millis] [OPTIONS]

    Note:

    The update command returns a work request ID. To see the command results, use the health-checker get command.
    Example updating health-checker protocol from TCP to HTTP:
    oci lb health-checker update --backend-set-name Example-Backend-Set \
      --interval-in-millis 10000 --load-balancer-id [ocid1.loadbalancer....….….….uniqueID] \ 
      --port 80 --protocol HTTP --return-code 200 --retries 3 --timeout-in-millis 3000 \
      --response-body-regex HEALTH --retries 3 
    
    {
      "opc-work-request-id": "ocid1.workrequest.1X49XC30ZP...unique_ID"
    } 

    Note:

    The update command returns a work request ID. To see the health-checker update results, use the health-checker get command.
    $ oci lb health-checker get --backend-set-name Example-Backend-Set 
      --load-balancer-id ocid1.load-balancer...unique_ID    
    
    {
      "data": {
        "interval-in-millis": 10000,
        "port": 80,
        "protocol": "HTTP",
        "response-body-regex": "HEALTH",
        "retries": 3,
        "return-code": 200,
        "timeout-in-millis": 3000,
        "url-path": "/"
      }
    }