Guide: How to create a Load Balancer
How to create a Load Balancer
- Create a security group for Load Balancer
- Create a new Load Balancer
- Add a new node to Load Balancer
- Remove a node from Load Balancer
1. Create a security group for Load Balancer
Security Group with the role of allowing incoming connections on port 80 is required for Load Balancer. By default there is no such role, so you need to create it.
1. Go to Infrastructure – Network and choose the Security Groups tab.
2. Select +ADD to create a new Security Group.
3. Complete the fields and click SAVE CHANGES.
4. Select your newly created Security Group and click +ADD RULE.
5. Complete the fields as below
NAME: Type your name, for example allow_http.
RULE TYPE: Custom Rule
PORT RANGE: 80
SOURCE TYPE: Network
DESTINATION TYPE: Instance
Click SAVE CHANGES.
2. Create a new Load Balancer
Load Balancer is created and managed in the Instances section. It is a virtual machine with preinstalled Apache software.
Important! There is a restriction that does not allow adding existing virtual machines. Nodes can be created after creating the Load Balancer.
1. Go to Provisioning – Instances and select +ADD to create a new instance.
2. Click the All icon and select APACHE type instance, then click NEXT.
3. Name your instance and click NEXT.
4. Select your newly created security group from SECURITY GROUP dropdown.
Important! Do not set the FLOATING IP.
5. In the AUTOMATION tab, expand the Load Balancer and complete the fields as below:
BACKEND 80: Octavia Service
VIP PORT: 80
VIP HOSTNAME: <your-load-balancer-name>.localdomain (keep default)
FLOATING IP: external
BALANCE MODE: You can choose least connections or round robin
STICKY MODE: sourceip
SSL CERT: No SSL
6. Make sure all settings are correct and click COMPLETE.
7. After provisioning the instance, click Http link to open the load balancer webpage.
8. If you can see the content as below, it means your load balancer works properly.
3. Add a new node to Load Balancer
1. To add a new node, go to your Apache instance and select ACTIONS – Add Apache Node.
2. Set how many nodes you want to create and click EXECUTE.
4. Remove a node from Load Balancer
1. To remove a new node, go to your Apache instance and find section VMS.
2. Select ACTIONS – Remove Apache Node on the node you want to remove.
3. Confirm to remove the node.