Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

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

    $ source ~/overcloudrc
    Copy to Clipboard Toggle word wrap

  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

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

  3. Verify the state of the load balancer.

    Example

    $ openstack loadbalancer show lb1
    Copy to Clipboard Toggle word wrap

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

    Example

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

  6. Verify the state of the listener.

    Example

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

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

  7. Create the listener default pool (pool1).

    Example

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

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

    Example

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

  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

    $ 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
    Copy to Clipboard Toggle word wrap

Verification

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

    Example

    $ openstack loadbalancer show lb1
    Copy to Clipboard Toggle word wrap

    Sample output

    +---------------------+--------------------------------------+
    | 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 |
    +---------------------+--------------------------------------+
    Copy to Clipboard Toggle word wrap

  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

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

    Sample output

    +---------------------+--------------------------------------+
    | 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                                |
    +---------------------+--------------------------------------+
    Copy to Clipboard Toggle word wrap

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

    $ source ~/overcloudrc
    Copy to Clipboard Toggle word wrap

  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

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

  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

    $ openstack loadbalancer show lb1
    Copy to Clipboard Toggle word wrap

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

    Example

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

  7. Create the listener default pool (pool1).

    Example

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

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

    Example

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

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

    Example

    $ 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
    Copy to Clipboard Toggle word wrap

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

    Example

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

  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

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

Verification

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

    Example

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

    Sample output

    * 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
    Copy to Clipboard Toggle word wrap

  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

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

    Sample output

    +---------------------+--------------------------------------+
    | 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                                |
    +---------------------+--------------------------------------+
    Copy to Clipboard Toggle word wrap

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

    $ source ~/overcloudrc
    Copy to Clipboard Toggle word wrap

  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

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

  3. Verify the state of the load balancer.

    Example

    $ openstack loadbalancer show lb1
    Copy to Clipboard Toggle word wrap

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

    Example

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

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

    Example

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

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

    Example

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

  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

    $ 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
    Copy to Clipboard Toggle word wrap

Verification

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

    Example

    $ openstack loadbalancer show lb1
    Copy to Clipboard Toggle word wrap

    Sample output

    +---------------------+--------------------------------------+
    | 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 |
    +---------------------+--------------------------------------+
    Copy to Clipboard Toggle word wrap

  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

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

    Sample output

    +---------------------+--------------------------------------+
    | 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                                |
    +---------------------+--------------------------------------+
    Copy to Clipboard Toggle word wrap

Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat