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

Compare with Current View Page History

« Previous Version 4 Next »

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

We provide users with an alternative procedure based on the OpenStack CLI and OpenStack Octavia plugin. We refer to Octavia documentation:  Basic Load Balancing Cookbook

Environment requirements

You will need the OpenStack Client and the Octavia plugin.  

pip install python-octaviaclient

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

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. 

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
  • 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 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. 


  • No labels