Load balancer¶
[Update: May 15, 2019]
This is the general information about [Load Balancer] appliance.
Overview¶
The [Load Balancer] function is a service to provide a load balancer that works as a virtual appliance. Through operation on the control panel, it is possible to introduce a load balancing environment quickly and easily into the environment that has been already built on the cloud.
You can select from the [Standard Plan] or [High Spec Plan] for each processing performance and [Single Router] or [Redundant Configuration] depending on the usage of redundant configuration.
See also
ロードバランサと、 エンハンスドロードバランサ 、 GSLB 、 Netwiser の違いについては、よくある質問と回答の 4種類のロードバランサアプライアンスの違いは何ですか? を参照ください。
Fees¶
For rates, please refer to Service site.
Specifications¶
The load balancer specifications provided by the [Load Balancer] function are as follows:
General specifications¶
Configuration | DSR (Direct Server Return) method |
---|---|
Supported protocols | TCP |
Redundant configuration of the load balancer | It supports redundant configuration that uses VRRP. |
Virtual IP address (VIP), port number | Up to 10 |
Number of real servers that can be set | Up to 40 servers per load balancer |
Distribution algorithm | Least connection (Not changeable) |
Session maintenance function | No |
Health check judgment | Number of checks for server down judgment: once (timeout judgment: 3 seconds) Number of checks for server up judgment: once |
Performance estimate (Maximum value) | Standard plan Outbound traffic: 100Mbps Inbound traffic: 100Mbps Number of sessions: 4,000 sessions Connection count per second: About 100cps High spec plan Outbound traffic: 1Gbps Inbound traffic: 500Mbps Number of sessions: 10,000 sessions Connection count per second: About 3,000cps |
*All of them are estimated maximum values. These performance values are not necessarily guaranteed.
Registration of virtual IP addresses¶
The following items can be set on the screen to add virtual IP addresses.
VIP address | Set the virtual IP address covered by the load balancer. |
---|---|
Port number | Set the port number for inbound traffic with virtual IP address. It should be an integer value from 1 to 65535. |
Check interval (seconds) | Set the interval at which alive monitoring of the real server is performed. It should be an integer value of 10 or more. |
Sorry server | Set the destination in case all the balancing destinations are in the down state. |
*After you add or change the setting, you need to click the [Update] button to reflect the setting contents to load balancer.
*Setting of the sorry server is not a required item.
*The sorry server needs to be created by the user. (Server fee is applied separately. )
Real Server Registration¶
The following items can be set on the screen to add real servers as the load balancing destination for each virtual IP address.
IP address | Set the IP address of the server of the load balancing destination. |
---|---|
Monitoring method | The monitoring method of the server of the load balancing destination assigned by IP address and port number is set by http, https, ping or tcp. When http or https is specified, additional setting items are displayed, and you can set the path to be monitored and the response code to be returned when normal. |
*After you add or change the setting, you need to click the [Update] button to reflect the setting contents to load balancer.
Configuration example¶
This is an example of installing a load balancer on a network composed of [Router + Switch] and [Switch] respectively. Because the load balancer provided by SAKURA Cloud operates by the DSR method, it will be added in parallel to the switch to which the servers you want to apply load balancing are connected.
Load balancing of the web servers by combining router + switch¶
This is an example of balancing load of multiple web servers to which IP address blocks are assigned by the router + switch function using the load balancer of redundant configuration.
The information about the assumed network is as follows:
IP address bandwidth | 203.0.113.0/28 |
---|---|
Gateway | 203.0.113.1 |
Redundant configuration load balancer 1 (*1) | 203.0.113.4 |
Redundant configuration load balancer 2 (*2) | 203.0.113.5 |
Web server 1 | 203.0.113.6 |
Web server 2 | 203.0.113.7 |
Load balancer virtual IP address | 203.0.113.8 |
*1: On the load balancer information screen of the control panel, it is expressed as [IPv4 address # 1].
*2: On the load balancer information screen of the control panel, it is expressed as [IPv4 address #2].
Load balancing of a database server by combining switches¶
This is an example of creating a private network environment using the switch function and balancing the load of the database server which is the back end of the web server using a load balancer.
The information about the assumed network is as follows:
IP address bandwidth | 192.168.1.0/24 |
---|---|
Web server (on the private network side) | 192.168.1.1 |
Load balancer | 192.168.1.2 |
DB server 1 | 192.168.1.3 |
DB server 2 | 192.168.1.4 |
Load balancer virtual IP address | 192.168.1.10 |
Movement when a sorry server is set¶
On the screen to add virtual IP addresses, you can set the server that responds when all real servers become unavailable by specifying the IP address of an arbitrary server that is installed under the load balancer in the [Sorry Server] section.
The sorry server responds when it detects unavailability of all real servers to which a load balancer is installed. This is convenient when you want to perform an operation to display a maintenance screen when a real server stops normal function due to high load, server failure, etc.
Installation settings¶
Here, we will use the above-mentioned configuration of “Load balancing of the web servers by combining router + switch” as an example.
1. Creation of router + switch or switch¶
When installing a load balancer into the SAKURA Cloud environment, you must have a network consisting of [Router + Switch] or [Switch]. Please refer to the online manual for detailed information on these functions.
2. Network setting of real servers¶
Network setting on the real server side is required to enable load balancing operation in the DSR configuration. The setting procedures and setting items are the same as installing a general DSR configuration load balancer. Apply these settings to all real servers.
Procedure for CentOS 6/7¶
Adding the setting of sysctl.conf¶
Set the kernel parameters so that it does not respond to ARP requests with the virtual IP address set as a loopback address. Add the following two-line setting to the /etc/sysctl.conf file.
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
After adding the setting, update the setting contents of sysctl.conf.
# sysctl -p
Adding a loopback address¶
Create a new lo:0 device and set the virtual IP address (203.0.113.8 in this configuration example). Create a new /etc/sysconfig/network-scripts/ifcfg-lo:0 file and enter the following contents.
DEVICE=lo:0
IPADDR=203.0.113.8
NETMASK=255.255.255.255
After creation, activate the lo: 0 device.
# ifup lo:0
Make sure that the settings are enabled with the ip command.
# ip a
1: lo: mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet 203.0.113.8/32 brd 203.0.113.8 scope global lo:0
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
Ubuntu14.04 procedure¶
On iptables, add a setting to redirect the virtual IP address (203.0.113.8 in this configuration example).
sudo iptables -t nat -A PREROUTING -d 203.0.113.8 -j REDIRECT
Install iptables-persistent in order to persist the setting of iptables.
sudo apt-get install iptables-persistent
3. Setting on the control panel¶
After completing the setting of each server as the load balancing destination, perform a setting of adding a load balancer on the control panel.
Confirmation of the current network¶
Confirm the current network configuration. Click the [Map] button in the menu on the left to display the connection map of the switch and the servers. You can see that it is in the state before a load balancer is added in the configuration example 1 (state in which two web servers are connected to a switch).
Adding a load balancer¶
Add a load balancer to the switch. When you click [Appliance] on the menu at the top of the screen, the load balancer list screen will appear. Click the [Add] button at the upper left of this screen to start the creation.
Enter and select the following contents as in configuration example 1. Based on assumed web traffic, we will use the [Standard Plan] load balancer this time.
Connected switch | Switch that you want to connect a load balancer to |
---|---|
Redundant configuration | Yes |
Plan | Standard plan |
VRID | 1 (Because there is only one load balancer installed in the network, it remains as the default setting.) |
IPv4 address #1 | 203.0.113.4 |
IPv4 address #2 | 203.0.113.5 |
Net mask | 28 |
Gateway | 203.0.113.1 |
Based on this information, enter each item in the control panel.
Warning
VRID must be unique on the same network. Since VRID cannot be changed after creation, please make sure not to duplicate VRID if there are VRRP-enabled appliances (VPC router, load balancer) or a virtual server that runs VRRP on the same network.
After entering the information, click the [Create] button and start creating a load balancer (*). After creation, double-click the corresponding load balancer on the load balancer list screen and confirm that there is no problem with the contents entered at the time of creation.
*After creation, it takes a few minutes for the load balancer to be available. Please use it after confirming that [Available] is shown in the status field of the load balancer list screen.
Migrating
Available
Setting a virtual IP address of the load balancer¶
Set a virtual IP address on the load balancer. On the load balancer list screen, double-click the corresponding load balancer and click the [VIP Setting] tab.
When you click the [Add] button at the bottom right, the screen to add virtual IP addresses will appear. Enter each item.
Because this is the load balancing of the web server, use “80” to specify the port number. In addition, the check interval was set to the default value of 10 seconds. (it will be the monitoring interval of the service operation state of the real servers described later.)
VIP address | 203.0.113.8 |
---|---|
Port number | 80 |
Check interval (seconds) | 10 |
After entering the information, click the [Create] button to set the virtual IP address. Click the [Update] button to enable the setting.
The virtual IP address which was set in the pop-up menu at the screen for the [Real Server] tab is newly displayed.
Registration of real servers to the virtual IP address¶
Register the real servers that are the subjects of load balancing to the virtual IP address that has been set up so far. In the case of “Web server # 1 (203.0.113.6)” in this configuration example, the setting values are as follows.
IP address | 203.0.113.6 |
---|---|
Port number | 80 |
Monitoring method | http |
Path | /index.html |
Response code | 200 |
Although ping and tcp can also be selected as other monitoring methods, this time, we choose to monitor with http because this is to set a load balancing of the web server. As this makes it possible to perform alive monitoring using the specified path/response code, it will be a more reliable monitoring when you make redundant configuration of the web server.
Click the [Add] button on the virtual IP address tab screen confirmed in the previous section to display the screen to add real servers and enter the information.
Similarly, register “Web server #2” as a real server. After registration is completed, click the [Update] button.
After all real servers are registered, the list will look like this.
Update the setting contents¶
The settings that have been configured so far are not updated immediately on the load balancer side. After adding or changing the settings, make sure to click the [Update] button. The settings will take effect immediately after clicking the [Update] button.
Confirming the operation status of the load balancer¶
From the [Real Server] tab, you can check the operation status of the real server operating under each virtual IP address that was set.
Status | Depending on the specified monitoring method, “UP” will appear if the response on the real server is normal, and “DOWN” will appear if there is an error. |
---|---|
Number of active connections | The current number of active tcp connections that are in the “Establish” state handled by the load balancer is shown. Normally, they are distributed equally to the servers to which load balancing is applied. |
Management after installation¶
Display of the activity monitor¶
The load balancer traffic graph will appear. Operation, such as enlarging a specific time, can be done in the same way as the server activity monitor.
Changing the settings¶
On the VIP setting screen and the real server setting screen for each VIP, you can edit the setting contents and delete the settings using the icon on the right of the list.
The same screen as adding settings will appear, and you can change the setting values. | |
---|---|
Deleting the settings |
After changing the settings, make sure to click the [Update] button on the screen and reflect the setting contents to the load balancer side.
Power operation¶
Like ordinary servers, you can stop and restart a load balancer. Open an individual load balancer screen and execute from the [Power Operation] menu on the upper left.
Deleting a load balancer¶
It is necessary to shut down the load balancer before deleting it. After shutting it down on the [Power Operation] menu, confirm that the power supply is in the “DOWN” state and click the delete button.