Load Balancer is a solution that involves balancing the load of servers and the applications installed on them. Load Balancer is a special type of server that distributes network traffic between server clusters. The advantages of this solution are high availability of your resources, which affects, among other things, the reliability and loading time of your website or application.
Load Balancer in e24cloud
With e24cloud Load Balancer service, you can ensure high availability of your application. The user defines the port on which Load Balancer listens and endpoints - virtual servers.
Application availability with Load Balancer
In the following examples, we will consider a scenario in which we create a Load Balancer to ensure high
availability for our application running on port 80
- HTTP. We have two servers - both running NGINX.
We can create a load balancer using one of two possible types of networks:
We will discuss both methods below.
How to create Load Balancer using VXLAN network?
The architecture we want to create in this example will look as follows:
First, we need to create a private VXLAN network that will be used for communication between Load Balancer <-> endpoints.
To create a Load Balancer, go to Servers in the left menu, and then select Load Balancers e24cloud. Then click on the Add new Load Balancer button. In the form that appears, enter the location of the Load Balancer and its name.
In the next step, we select the VXLAN network previously created for internal communication with endpoints. We also provide the IP address of the Load Balancer in the internal network. The next step is to add the port/ports on which the application is running, as well as the IP address/addresses of the endpoints to which the network traffic will be redirected. Finally, we click on the Create Load Balancer button. The Load Balancer will be created and assigned a public IP address.
After adding the Load Balancer, we will see it on the list.
Verification
The Load Balancer checks for the presence of the backend-test
file in the root directory on each endpoint at 1-second
intervals. If the HTTP code
is different than 200, the Load Balancer will stop directing traffic to the problematic
endpoint. If everything is configured correctly, accessing the Load Balancer via HTTP protocol should display the content
of one of the endpoints.
How to create a Load Balancer using VDC?
The architecture that we want to create in this example will look like this:
First, we need to create a L3 network with NAT for communication between the Load Balancer and endpoints. Remember to add virtual servers to the L3 network after creating it, as these will be the endpoints between which the Load Balancer will distribute network traffic.
To create a Load Balancer, select Servers from the menu on the left, then e24cloud Load Balancers. Next, click the Add new Load Balancer button. In the form that appears, enter the location and name of the Load Balancer, from which the hostname of the L3 network will be automatically generated. Then select the previously created L3 network.
In the next step, provide the port/ports on which the Load Balancer will communicate with the servers in our private L3 network, and specify the private IP addresses of those servers. Finally, click the Create Load Balancer button. The Load Balancer will be created and assigned a public IP address, which will be associated with the L3 network.
After adding the Load Balancer, we will see it on the list, just like in the case of a Load Balancer created using the VXLAN network.