Chapter 8. Creating non-secure HTTP load balancers


You can create the following load balancers for non-secure HTTP network traffic:

8.1. Creating an HTTP load balancer with a health monitor

For networks that are not compatible with Red Hat OpenStack Platform Networking service (neutron) floating IPs, create a load balancer to manage network traffic for non-secure HTTP applications. Create a health monitor to ensure that your back-end members remain available.

Prerequisites

  • A private subnet that contains back-end servers that host non-secure HTTP applications on TCP port 80.
  • The back-end servers on the private subnet are configured with a health check at the URL path /.
  • A shared external (public) subnet that you can reach from the internet.

Procedure

  1. Source your credentials file.

    Example

    Copy to Clipboard Toggle word wrap
    $ source ~/overcloudrc

  2. Create a load balancer (lb1) on a public subnet (public_subnet).

    Note

    Values inside parentheses are sample values that are used in the example commands in this procedure. Substitute these sample values with ones that are appropriate for your site.

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer create --name lb1 --vip-subnet-id public_subnet

  3. Verify the state of the load balancer.

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer show lb1

  4. Before going to the next step, ensure that the provisioning_status is ACTIVE.
  5. Create a listener (listener1) on a port (80).

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer listener create --name listener1 --protocol HTTP --protocol-port 80 lb1

  6. Verify the state of the listener.

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer listener show listener1

    Before going to the next step, ensure that the status is ACTIVE.

  7. Create the listener default pool (pool1).

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer pool create --name pool1 --lb-algorithm ROUND_ROBIN --listener listener1 --protocol HTTP

  8. Create a health monitor on the pool (pool1) that connects to the back-end servers and tests the path (/).

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer healthmonitor create --delay 15 --max-retries 4 --timeout 10 --type HTTP --url-path / pool1

  9. Add load balancer members (192.0.2.10 and 192.0.2.11) on the private subnet (private_subnet) to the default pool.

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer member create --subnet-id private_subnet --address 192.0.2.10 --protocol-port 80 pool1
    $ openstack loadbalancer member create --subnet-id private_subnet --address 192.0.2.11 --protocol-port 80 pool1

Verification

  1. View and verify the load balancer (lb1) settings:

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer show lb1

    Sample output

    Copy to Clipboard Toggle word wrap
    +---------------------+--------------------------------------+
    | Field               | Value                                |
    +---------------------+--------------------------------------+
    | admin_state_up      | True                                 |
    | created_at          | 2022-01-15T11:11:09                  |
    | description         |                                      |
    | flavor              |                                      |
    | id                  | 788fe121-3dec-4e1b-8360-4020642238b0 |
    | listeners           | 09f28053-fde8-4c78-88b9-0f191d84120e |
    | name                | lb1                                  |
    | operating_status    | ONLINE                               |
    | pools               | 627842b3-eed8-4f5f-9f4a-01a738e64d6a |
    | project_id          | dda678ca5b1241e7ad7bf7eb211a2fd7     |
    | provider            | amphora                              |
    | provisioning_status | ACTIVE                               |
    | updated_at          | 2022-01-15T11:12:13                  |
    | vip_address         | 198.51.100.12                        |
    | vip_network_id      | 9bca13be-f18d-49a5-a83d-9d487827fd16 |
    | vip_port_id         | 69a85edd-5b1c-458f-96f2-b4552b15b8e6 |
    | vip_qos_policy_id   | None                                 |
    | vip_subnet_id       | 5bd7334b-49b3-4849-b3a2-b0b83852dba1 |
    +---------------------+--------------------------------------+

  2. When a health monitor is present and functioning properly, you can check the status of each member.

    A working member (b85c807e-4d7c-4cbd-b725-5e8afddf80d2) has an ONLINE value for its operating_status.

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer member show pool1 b85c807e-4d7c-4cbd-b725-5e8afddf80d2

    Sample output

    Copy to Clipboard Toggle word wrap
    +---------------------+--------------------------------------+
    | Field               | Value                                |
    +---------------------+--------------------------------------+
    | address             | 192.0.2.10                           |
    | admin_state_up      | True                                 |
    | created_at          | 2022-01-15T11:16:23                  |
    | id                  | b85c807e-4d7c-4cbd-b725-5e8afddf80d2 |
    | name                |                                      |
    | operating_status    | ONLINE                               |
    | project_id          | dda678ca5b1241e7ad7bf7eb211a2fd7     |
    | protocol_port       | 80                                   |
    | provisioning_status | ACTIVE                               |
    | subnet_id           | 5bd7334b-49b3-4849-b3a2-b0b83852dba1 |
    | updated_at          | 2022-01-15T11:20:45                  |
    | weight              | 1                                    |
    | monitor_port        | None                                 |
    | monitor_address     | None                                 |
    | backup              | False                                |
    +---------------------+--------------------------------------+

Additional resources

8.2. Creating an HTTP load balancer that uses a floating IP

To manage network traffic for non-secure HTTP applications, create a load balancer with a virtual IP (VIP) that depends on a floating IP. The advantage of using a floating IP is that you retain control of the assigned IP, which is necessary if you need to move, destroy, or recreate your load balancer. It is a best practice to also create a health monitor to ensure that your back-end members remain available.

Note

Floating IPs do not work with IPv6 networks.

Prerequisites

  • A private subnet that contains back-end servers that host non-secure HTTP applications on TCP port 80.
  • The back-end servers are configured with a health check at the URL path /.
  • A floating IP to use with a load balancer VIP.
  • A Red Hat OpenStack Platform Networking service (neutron) shared external (public) subnet that you can reach from the internet to use for the floating IP.

Procedure

  1. Source your credentials file.

    Example

    Copy to Clipboard Toggle word wrap
    $ source ~/overcloudrc

  2. Create a load balancer (lb1) on a private subnet (private_subnet).

    Note

    Values inside parentheses are sample values that are used in the example commands in this procedure. Substitute these sample values with ones that are appropriate for your site.

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer create --name lb1 --vip-subnet-id private_subnet

  3. Note the value of load_balancer_vip_port_id, because you must provide it in a later step.
  4. Verify the state of the load balancer.

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer show lb1

  5. Before going to the next step, ensure that the provisioning_status is ACTIVE.
  6. Create a listener (listener1) on a port (80).

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer listener create --name listener1 --protocol HTTP --protocol-port 80 lb1

  7. Create the listener default pool (pool1).

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer pool create --name pool1 --lb-algorithm ROUND_ROBIN --listener listener1 --protocol HTTP

  8. Create a health monitor on the pool (pool1) that connects to the back-end servers and tests the path (/).

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer healthmonitor create --delay 15 --max-retries 4 --timeout 10 --type HTTP --url-path / pool1

  9. Add load balancer members (192.0.2.10 and 192.0.2.11) on the private subnet to the default pool.

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer member create --subnet-id private_subnet --address 192.0.2.10 --protocol-port 80 pool1
    $ openstack loadbalancer member create --subnet-id private_subnet --address 192.0.2.11 --protocol-port 80 pool1

  10. Create a floating IP address on the shared external subnet (public).

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack floating ip create public

  11. Note the value of floating_ip_address, because you must provide it in a later step.
  12. Associate this floating IP (203.0.113.0) with the load balancer vip_port_id (69a85edd-5b1c-458f-96f2-b4552b15b8e6).

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack floating ip set --port 69a85edd-5b1c-458f-96f2-b4552b15b8e6 203.0.113.0

Verification

  1. Verify HTTP traffic flows across the load balancer by using the floating IP (203.0.113.0).

    Example

    Copy to Clipboard Toggle word wrap
    $ curl -v http://203.0.113.0 --insecure

    Sample output

    Copy to Clipboard Toggle word wrap
    * About to connect() to 203.0.113.0 port 80 (#0)
    *   Trying 203.0.113.0...
    * Connected to 203.0.113.0 (203.0.113.0) port 80 (#0)
    > GET / HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: 203.0.113.0
    > Accept: */*
    >
    < HTTP/1.1 200 OK
    < Content-Length: 30
    <
    * Connection #0 to host 203.0.113.0 left intact

  2. When a health monitor is present and functioning properly, you can check the status of each member.

    A working member (b85c807e-4d7c-4cbd-b725-5e8afddf80d2) has an ONLINE value for its operating_status.

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer member show pool1 b85c807e-4d7c-4cbd-b725-5e8afddf80d2

    Sample output

    Copy to Clipboard Toggle word wrap
    +---------------------+--------------------------------------+
    | Field               | Value                                |
    +---------------------+--------------------------------------+
    | address             | 192.0.02.10                          |
    | admin_state_up      | True                                 |
    | created_at          | 2022-01-15T11:11:23                  |
    | id                  | b85c807e-4d7c-4cbd-b725-5e8afddf80d2 |
    | name                |                                      |
    | operating_status    | ONLINE                               |
    | project_id          | dda678ca5b1241e7ad7bf7eb211a2fd7     |
    | protocol_port       | 80                                   |
    | provisioning_status | ACTIVE                               |
    | subnet_id           | 5bd7334b-49b3-4849-b3a2-b0b83852dba1 |
    | updated_at          | 2022-01-15T11:28:42                  |
    | weight              | 1                                    |
    | monitor_port        | None                                 |
    | monitor_address     | None                                 |
    | backup              | False                                |
    +---------------------+--------------------------------------+

Additional resources

  • loadbalancer in the Command Line Interface Reference
  • floating in the Command Line Interface Reference

8.3. Creating an HTTP load balancer with session persistence

To manage network traffic for non-secure HTTP applications, you can create load balancers that track session persistence. Doing so ensures that when a request comes in, the load balancer directs subsequent requests from the same client to the same back-end server. Session persistence optimizes load balancing by saving time and memory.

Prerequisites

  • A private subnet that contains back-end servers that host non-secure HTTP applications on TCP port 80.
  • The back-end servers are configured with a health check at the URL path /.
  • A shared external (public) subnet that you can reach from the internet.
  • The non-secure web applications whose network traffic you are load balancing have cookies enabled.

Procedure

  1. Source your credentials file.

    Example

    Copy to Clipboard Toggle word wrap
    $ source ~/overcloudrc

  2. Create a load balancer (lb1) on a public subnet (public_subnet).

    Note

    Values inside parentheses are sample values that are used in the example commands in this procedure. Substitute these sample values with ones that are appropriate for your site.

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer create --name lb1 --vip-subnet-id public_subnet

  3. Verify the state of the load balancer.

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer show lb1

  4. Before going to the next step, ensure that the provisioning_status is ACTIVE.
  5. Create a listener (listener1) on a port (80).

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer listener create --name listener1 --protocol HTTP --protocol-port 80 lb1

  6. Create the listener default pool (pool1) that defines session persistence on a cookie (PHPSESSIONID).

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer pool create --name pool1 --lb-algorithm ROUND_ROBIN --listener listener1 --protocol HTTP --session-persistence type=APP_COOKIE,cookie_name=PHPSESSIONID

  7. Create a health monitor on the pool (pool1) that connects to the back-end servers and tests the path (/).

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer healthmonitor create --delay 15 --max-retries 4 --timeout 10 --type HTTP --url-path / pool1

  8. Add load balancer members (192.0.2.10 and 192.0.2.11) on the private subnet (private_subnet) to the default pool.

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer member create --subnet-id private_subnet --address 192.0.2.10 --protocol-port 80 pool1
    $ openstack loadbalancer member create --subnet-id private_subnet --address 192.0.2.11 --protocol-port 80 pool1

Verification

  1. View and verify the load balancer (lb1) settings:

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer show lb1

    Sample output

    Copy to Clipboard Toggle word wrap
    +---------------------+--------------------------------------+
    | Field               | Value                                |
    +---------------------+--------------------------------------+
    | admin_state_up      | True                                 |
    | created_at          | 2022-01-15T11:11:58                  |
    | description         |                                      |
    | flavor              |                                      |
    | id                  | 788fe121-3dec-4e1b-8360-4020642238b0 |
    | listeners           | 09f28053-fde8-4c78-88b9-0f191d84120e |
    | name                | lb1                                  |
    | operating_status    | ONLINE                               |
    | pools               | 627842b3-eed8-4f5f-9f4a-01a738e64d6a |
    | project_id          | dda678ca5b1241e7ad7bf7eb211a2fd7     |
    | provider            | amphora                              |
    | provisioning_status | ACTIVE                               |
    | updated_at          | 2022-01-15T11:28:42                  |
    | vip_address         | 198.51.100.22                        |
    | vip_network_id      | 9bca13be-f18d-49a5-a83d-9d487827fd16 |
    | vip_port_id         | 69a85edd-5b1c-458f-96f2-b4552b15b8e6 |
    | vip_qos_policy_id   | None                                 |
    | vip_subnet_id       | 5bd7334b-49b3-4849-b3a2-b0b83852dba1 |
    +---------------------+--------------------------------------+

  2. When a health monitor is present and functioning properly, you can check the status of each member.

    A working member (b85c807e-4d7c-4cbd-b725-5e8afddf80d2) has an ONLINE value for its operating_status.

    Example

    Copy to Clipboard Toggle word wrap
    $ openstack loadbalancer member show pool1 b85c807e-4d7c-4cbd-b725-5e8afddf80d2

    Sample output

    Copy to Clipboard Toggle word wrap
    +---------------------+--------------------------------------+
    | Field               | Value                                |
    +---------------------+--------------------------------------+
    | address             | 192.0.02.10                          |
    | admin_state_up      | True                                 |
    | created_at          | 2022-01-15T11:11:23                  |
    | id                  | b85c807e-4d7c-4cbd-b725-5e8afddf80d2 |
    | name                |                                      |
    | operating_status    | ONLINE                               |
    | project_id          | dda678ca5b1241e7ad7bf7eb211a2fd7     |
    | protocol_port       | 80                                   |
    | provisioning_status | ACTIVE                               |
    | subnet_id           | 5bd7334b-49b3-4849-b3a2-b0b83852dba1 |
    | updated_at          | 2022-01-15T11:28:42                  |
    | weight              | 1                                    |
    | monitor_port        | None                                 |
    | monitor_address     | None                                 |
    | backup              | False                                |
    +---------------------+--------------------------------------+

Additional resources

Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat, Inc.