Todas as coleções
Network
How to apply load balancing in BCOS?
How to apply load balancing in BCOS?

Learn how to apply load balancing between two distinct virtual machines in the BCOS environment.

Luiz Fernando Justino Silva avatar
Escrito por Luiz Fernando Justino Silva
Updated over a week ago

Create Load Balancer

  Load balancing is a feature that allows load distribution between two or more servers evenly, so overloading a server becomes less likely, with this feature increasing the performance of your servers.

  Create two instances (if not) with the following specifications:

  • Instance name: VM06.

  • Select Boot Source: Imagem.

  • Create New Volume: Não.

  • Image name: Ubuntu-16.04-LTS.

  • Flavor: bc-1-1024-30.

  • Network: network-production.

  • Security group: default, ALLOW ICMP, ALLOW SSH, ALLOW HTTP.

  • Key Pairs: prod01.

  • Configuration:

          Customization Script:

           #!/bin/bash

           sudo -i

           apt-get update

           apt-get install -y apache2

           echo 'Apache-VM06' > /var/www/html/index.html

  If you have questions about the instance creation process go to How do I create instances in BCOS? to know more.

 To apply a load balance ininstances, go to Project/Network/Load Balancers and click in Create Load Balancer:

  Choose the subnet and click in Next:

  • Subnet: subnet-production.

  Select the protocol, enter the port number and click in Next:

  • Protocol: HTTP.

  • Port: 80.

   In Method select ROUND_ROBIN and click in Next:

  • Method: ROUND_ROBIN.

  Add two machines that have apache installed, or create them if you don't know how to instantiate or install apache on them by going to How to create instances in BCOS?, then click in Next:

Example:

  • Pool Members: VM04.

  • Pool Members: VM06.

  Note: If the port number is blank, enter the number 80 in all selected instances.

   In Monitor Type select HTTP and click in Create Load Balancer:

  • Monitor Type: HTTP.

   Access the created Load Balance. In the actions button on the right, select and click in Associate Floating IP, on the next screen keep the public network and click in Associate:

   Access the Load Balancer 1 and verify your floating IP:

   Then access the floating IP associated with Load Balancer 1 from the local machine browser:

  • Floating IP associated: 45.225.25.x.

    Note the balance refreshing the page:

   There, the balance between VM04 and VM06 is applied.

   In the next post How to apply a VPN in BCOS?, we will see how to configure a VPN in BCOS environment.

Respondeu à sua pergunta?