Posts Tagged ‘Web Server Cluster’

ways to build session server (cluster)

January 13th, 2010

There are many ways to build centre session server.

Using LVS to build web server cluster

January 13th, 2010

LVS (Linux Virtual Server) is a common used application to build virtual server systems on Linux OS. Here we use it to build a web server cluster under Ubuntu.

The first step is to install ipvsadm on your load balancer:

$ sudo apt-get install ipvsadm

Then we can use ipvsadm to configure our virtual server system. Suppose our load balancer is134.21.2.1, and the real web servers are:

  • 134.21.2.2:80
  • 134.21.2.3:8080
  • 134.21.2.4:8088

We use these commands to add the service and the servers:

$ sudo ipvsadm -A -t 134.21.2.1:80 -s wlc                                            # add the service on the load balancer
$ sudo ipvsadm -a -t 134.21.2.1:80 -r 134.21.2.2 -m -w 100                  # add real web server No. 1 to the service
$ sudo ipvsadm -a -t 134.21.2.1:80 -r 134.21.2.3:8080 -m -w 100          # add real web server No. 2 to the service
$ sudo ipvsadm -a -t 134.21.2.1:80 -r 134.21.2.4:8088 -m -w 100          # add real web server No. 3 to the service

We also can use ipvsadim -d to delete a real server, for example:

$ sudo ipvsadm -d -t 134.21.2.1:80 -r 134.21.2.4:8088

More details please go to LVS Documents, or check the manual:

$ man ipvsadmin