You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Octavia service enables the deployment of load balancing solutions in OpenStack projects.  We refer to Octavia's official documentation for a full description of Octavia features. 

Due to a current malfunctioning of OpenStack Horizon, it is not possible to create load balancers through the ADA Cloud Dashboard.

In this guide, we provide users with an alternative procedure based on the OpenStack CLI and the OpenStack Octavia plugin following the Basic Load Balancing Cookbook

Load balancing

A load balancer functions as a traffic intermediary, directing network or application traffic to multiple server endpoints. It helps manage capacity during high traffic periods and enhances the reliability of applications. The main components of a load balancer are the following: 

  • Listener: The listener is a component that defines how incoming traffic is received. It listens for connection requests on a specific port and protocol (e.g., HTTP, HTTPS), and directs this traffic to the appropriate backend pool.
  • Pool: The pool is a collection of backend servers (also known as members) that receive and process the incoming traffic distributed by the load balancer. The pool determines the load balancing algorithm and health check policies to manage traffic distribution effectively.
  • Members: Members are the individual servers within a pool that handle the actual processing of the traffic. Each member represents a single endpoint (server) that performs the required tasks or services requested by the client.

A load balancer determines which server to send a request to based on a desired algorithms (e.g., Round Robin, Least Connections, Random). The choice among the load balancing algorithms depends on the requirements of the specific use case. 

How to deploy a basic HTTP load balancer with an associated Floating-IP

In this section, we will walk you through the steps to create a setup where two instances running nginx servers are connected to an HTTP load balancer. The load balancer will use the round-robin algorithm to evenly distribute incoming HTTP traffic across the two servers. This configuration will help distribute incoming traffic across the two servers. 

Environment requirements

You will need the OpenStack Client and the Octavia plugin.  

pip install python-octaviaclient

Prerequisites 

Before creating a load balancer, ensure that the following resources are available in your tenant:

  • 1 network.
  • 1 router.
  • Desired security groups for the VMs. 
  • 2 instances (nginx servers).
  • At least 3 floating IP: two associated to the VMs and an additional one available for the load balancer.

If you need to create these resources, you can follow our user guides

Procedure

1. Create a Load Balancer

openstack loadbalancer create --name <loadbalancer_name> --vip-subnet-id <subnet_id>

Note: Wait until creation is completed. It will take a while and the next steps will return an error if the load balancer is not available. 

2. Create a Listener

openstack loadbalancer listener create --name <listener_name> --protocol HTTP --protocol-port 80 <loadbalancer_name>

3. Create a Pool

openstack loadbalancer pool create --name <pool_name> --lb-algorithm <algorithm_e.g.ROUND_ROBIN> --listener <listener_name> --protocol HTTP

4. Add Members

openstack loadbalancer member create --subnet-id  <subnet_id> --address <ip_vm_1> --protocol-port 80 <pool_name>

openstack loadbalancer member create --subnet-id <subnet_id> --address <ip_vm_2> --protocol-port 80 <pool_name>

5. Associate an available Floating IP to the load balancer

openstack floating ip set --port <port_id> <floating_ip> 

You can identify the port_id if you navigate to the description of your load balancer. 

You can use this IP to reach the nginx servers (see figure bellow). The traffic will be managed by the load balancer following the algorithm <algorithm_e.g.ROUND_ROBIN> (see Step 3). 


  • No labels