Load-Balancer How-To


Flexi-Cloud Linux Load-Balancing Option - Order Here

Load balancing aids application availability and scalability. There are two load balancing options with your Netsonic Flexi-Cloud server:
  • Load balancing clusters
  • Virtual Machine Autoscaling
Load balancing clusters: With this option, you specify which VMs (nodes) will participate in a load balancing cluster. Incoming traffic is distributed evenly between all the VMs added to a cluster – you still present a single host name to end users, but they actually access the cluster of VMs rather than a single end point. This helps application availability: if one VM fails, traffic is automatically routed to another in the cluster. You can add and remove cluster VMs as required.

VM Autoscaling: Increases or decreases your VM capacity by automatically adding or removing nodes to a cluster. The cluster is scaled in (decreased) or out (increased) based on rules you specify in the Control panel. This aids application performance and scalability. (Not enabled for client use yet - Available Mid October 2011)

Please note: you must have a minimum of 6GB disk space and 512MB RAM free under your cloud hosting account in order to build a load-balancer and the load-balancer must be on the same IP subnet as the servers you wish to balance. You can upgrade your cloud hosting account to the next Block level if you need to add resources to accommodate this setup. If you need load-balancer setup help beyond what this article provides, admin time can be purchased under the Netsonic Hourly Administrative Services option.

Building the Load-Balancer

You will build the load-balancer itself by logging into your Flexi-Cloud portal and building a new server just like any other. The only difference when building a load-balancer instead of a regular cloud server is to select Linux as the OS, and Lbva as the Distribution in order to load the proper operating system template to enable the load-balancer (as shown below).

Add a Load-Balancing cluster (continued)
  • ..fill in the remainder of the form that appears:
Cluster Configuration
  • Port - specify the port for this load balancer to run on (e.g. 80, 9090, 8080, 9008 etc.)
    • Use 80 if you want to just do standard http (web) traffic load-balancing
Load Balancer Instance
  • Label – give a name for your load balancer instance
  • Hostname – specify a host name that will identify your load balancer
  • Port Speed – use the slider to set a port speed or tick the Unlimited box if required
Load Balancer Type
  • Choose the Cluster option
Cluster Nodes
This is where you add and configure the nodes in this load balancing cluster. A node is a combination of a VM and an IP address.
  • Virtual Machines – select a virtual machine from the drop-down box.
Please note that you can add to a cluster only those VMs  which are located in the same IP ranger.

Click Save.

Configuring the Linux servers to be load-balanced

Each real server (the servers being load-balanced) needs a loopback IP address to be configured as the VIP. This address needs to be stopped from responding to ARP requests and the web server needs to be configured to respond to this IP address.

With most modern Linux kernels (>2.6) you can alter the ARP behavior allowing you to configure a loopback adapter without worrying about ARP issues. To do this just add the following lines to /etc/sysctl.conf and re-boot, or run /sbin/sysctl.conf -p to reload the file:


Alternatively, the following commands may be used to change the settings interactively during runtime:

echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
echo 1 > /proc/sys/net/ipv4/conf/eth0/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce
echo 2 > /proc/sys/net/ipv4/conf/eth0/arp_announce

Once you have configured your Linux real server so that it won't respond to ARP requests for the loopback adapter you can configure your VIPs as follows:

ifconfig lo:0 VIP netmask up

..where "VIP" is the virtual IP (floating IP) or the second IP address shown in the load-balancer configuration found in the Flexi-Cloud portal.

Configuring DNS

Once your load-balancer is setup and the servers to be load-balanced are configured, you would update DNS for the site(s) being load-balanced and use the VIP (virtual/floating IP) in the DNS update. This will direct all inbound web traffic (or whatever protocol being balanced) to the load-balancer and from there, it will direct traffic to the servers behind it.

Monitoring Your Load-Balancer

You can fine-tune the configuration as well as monitor the status of your load-balancing cluster via the admin panel:


..and login with the username "root" with the password assigned to the system, which is found in the Flexi-Cloud server portal.