Skip to content
Snippets Groups Projects
Commit bff669bf authored by Mihail Avram's avatar Mihail Avram
Browse files

aggiungi guida creazione Load Balancer da Dashboard

parent 60159daa
No related branches found
No related tags found
No related merge requests found
...@@ -2,3 +2,5 @@ ...@@ -2,3 +2,5 @@
*.swp *.swp
*.swo *.swo
*~ *~
build
venv
web/support/kb/openstack/lb0.png

143 KiB

web/support/kb/openstack/lb1.png

53.5 KiB

web/support/kb/openstack/lb2.png

74.5 KiB

web/support/kb/openstack/lb3.png

92 KiB

web/support/kb/openstack/lb4.png

73.7 KiB

web/support/kb/openstack/lb5.png

94.1 KiB

web/support/kb/openstack/lb6.png

81.8 KiB

web/support/kb/openstack/lb7.png

61.5 KiB

web/support/kb/openstack/lb8.png

71.5 KiB

Create an Openstack LB Create an Openstack Load Balancer
====================== ======================
This guide shows how to create and use an Openstack LB. We will create two VMs, a LB that will balance the load between these two VMs, and will test the LB with curl. This guide shows how to create and use an Openstack Load Balancer. We will create two VMs, a Load Balancer that will balance the load between these two VMs, and will test the Load Balancer with curl.
Create the VMs Create the VMs
-------------- --------------
...@@ -12,6 +12,13 @@ Create a new security group that enables network traffic on port 80 and associat ...@@ -12,6 +12,13 @@ Create a new security group that enables network traffic on port 80 and associat
Create and associate a floating IP to each VM. Create and associate a floating IP to each VM.
**Note**: If the service is not visible from the Internet (0.0.0.0/0) create a security group that enables ingress traffic from the private
network of the VM's otherwise the Load Balancer will not be able to forward the requests to the worker VMs. In this case the CIDR of the security group rule
is the network IP.
.. image:: lb0.png
:width: 600
Run a simple web server Run a simple web server
----------------------- -----------------------
...@@ -28,7 +35,7 @@ On test-vm-2: ...@@ -28,7 +35,7 @@ On test-vm-2:
2. ``vim index.html`` -> <html>This is SERVER 2</html> 2. ``vim index.html`` -> <html>This is SERVER 2</html>
3. ``sudo python3 -m http.server 80 &> /dev/null &`` 3. ``sudo python3 -m http.server 80 &> /dev/null &``
Create a new LB Create a new Load Balancer (Openstack CLI)
--------------- ---------------
1. ``openstack loadbalancer create --name test-lb --vip-subnet-id <subnet-id>`` 1. ``openstack loadbalancer create --name test-lb --vip-subnet-id <subnet-id>``
...@@ -38,12 +45,58 @@ Create a new LB ...@@ -38,12 +45,58 @@ Create a new LB
5. ``openstack loadbalancer member create --subnet-id <subnet-id> --address <test-vm-2-private-ip> --protocol-port 80 test-pool`` 5. ``openstack loadbalancer member create --subnet-id <subnet-id> --address <test-vm-2-private-ip> --protocol-port 80 test-pool``
6. Get the loadbalancer vip port (vip_port_id) -> ``openstack loadbalancer show test-lb`` 6. Get the loadbalancer vip port (vip_port_id) -> ``openstack loadbalancer show test-lb``
7. Create a new floating ip through the Openstack Dashboard or CLI 7. Create a new floating ip through the Openstack Dashboard or CLI
8. Associate the previous floating ip to the LB vip port-> ``openstack floating ip set --port <vip-port-id> <floating-ip>`` 8. Associate the previous floating ip to the Load Balancer vip port-> ``openstack floating ip set --port <vip-port-id> <floating-ip>``
Create a new Load Balancer (Openstack Dashboard)
---------------
1. Select **Load Balancers** from the menu and select **+ Create Load Balancer**.
.. image:: lb1.png
:width: 600
2. Name the new load balancer and select the subnet (must be the same subnet of the VM's).
.. image:: lb2.png
:width: 600
3. Create a listener and select the protocol/port the load balancer listens to.
.. image:: lb3.png
:width: 600
4. Create a worker pool and select a load balancer algorithm. The choosen algorithm determines how the workload is distributed among members when new requests arrive.
.. image:: lb4.png
:width: 600
5. Add members to the new pool, and for each member select the interface and the port of the service running on that host.
.. image:: lb5.png
:width: 600
6. Create a monitor and select the type of service to monitor. Click on **Create Load Balancer** to finish.
.. image:: lb6.png
:width: 600
7. Wait until load balancer *Operating Status* becomes Online. If a member is unreachable to the load balancer *Operating Status* turns to *Degraded*, in that case the requests are routed to the remaining members.
.. image:: lb7.png
:width: 600
8. Assign a *Floating IP* to the new load balancer.
.. image:: lb8.png
:width: 600
**Note**: now it is possibile to remove the floating ips from the two VMs. **Note**: now it is possibile to remove the floating ips from the two VMs.
Test the LB
Test the Load Balancer
----------- -----------
``curl <LB-floating-ip>`` ``curl <Load-Balancer-floating-ip>``
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment