Clustering


The clustering page gives access to the admin server's controls for managing a 'server farm' - a cluster of webservers, optionally controlled by a Zeus Load Balancer.

Introduction to Clustering

It is often desirable to host websites over a cluster of machines, rather than just one machine. The main advantages are: Clustering provides the ability to manage multiple webserver machines in a server farm as if they were a single entity. The clustering support in Zeus server provides seamless management, administration and provisioning over multiple machines. The admin server allows to you deploy website configurations across the entire server farm at the click of a button, and monitor the activity in real-time of the server farm.

Load-balancing on the other hand, is separate to clustering. Load-balancing is the act of distributing the incoming network traffic across the cluster of webserver machines.

Load Balancing Options

Round-Robin DNS
The simplest way of hosting a site across multiple machines is to set up the DNS records, so that the site name has multiple IP addresses, and then have each machine in the cluster resolve to one IP address. For example, if you have two machines with addresses 10.0.0.1 and 10.0.0.2, you could make www.mysite.com have a DNS record that resolves to both addresses. Round-robin DNS is naive in the way it distributes load as it does not take into account the load on the web servers, or how fast the machines are. Nor does round-robin DNS does not provide any fault-tolerance.

Smart load-balancing routers
Several companies (such as Alteon, Arrowpoint and Cisco) provide switches or routers that can distribute the load across multiple back end machines. With some of these products all the web servers bind to the same IP addresses. These devices can provide fault-tolerance, and can typically balance the load based on either response-times or by the amount of network traffic.

The Zeus Load Balancer
The Zeus Load Balancer is a software solution that runs on generic UNIX hardware. It acts like a smart HTTP proxy balancing the load between the back-end machines. The Zeus Load Balancer monitors the response times of all the web servers, and forwards the requests to the machines that are responding the quickest. Should one of the web servers fail, incoming requests will be transparently routed to other machines. The real strength of the Zeus Load Balancer is that it integrates into the Zeus Admin Server, and fully supports both IP based and Host header based virtual hosting, and allows both dynamic session support whereby a client invoking a multi-page database transaction can be sent to the same back-end machine during the session/transaction, and segmentation of the backend hardware so only certain URLs can be hosted by subsets of the backend machines (e.g. those with an Oracle database or ASP functionality).


Screen-shot showing Zeus load-balancer software installed


Screen-shot showing status report from Zeus load-balancer software

The Zeus Load Balancer is available from Zeus Technology as a separate application.


Monitoring the status of your cluster

An icon is displayed for each machine configured in your cluster. These are grouped into two groups: front-end load-balancers and back-end servers. (The front-end load-balancers only appear when the Zeus Load Balancer application is installed). A machine operating abnormally (perhaps indicating a hardware failure) will have a red icon. The icons for each box can be clicked on to provide more information.

If you are using any non-Zeus backend webservers in a clustered install, they will also be shown on the page. However, because they lack the functionality of the Zeus Web Server, the admin server cannot check whether each non-Zeus server is working or not. You must check this for yourself.

Server operating normally
This server can communicate with the admin server and is serving requests. Click on the server icon for more information.
Failed or incorrectly configured server
The server has failed or the admin server cannot talk to it. This may happen if it has been incorrectly configured. Click on the server icon for more information.

The back-end web server machines also provide statistics, which can be viewed by clicking on a back-end server icon. They provide information on which sites being served are busiest, by default over a 5 minute interval.


How the back-end servers handle requests

When you start a web site, the admin server sends the configuration to each of the web servers you have configured. Each web server then writes out a local copy of that configuration file in $ZEUSHOME/web/runningsites. This means the web server machine can reboot/restart without needing to communicate with the admin server.

Rewriting Configuration

It is often necessary to have slightly different configuration on each web server. To make this process as easy as possible, Zeus Web Server provides a built-in mechanism for rewriting configuration settings on the fly.

When the web server receives a web site configuration from the admin server it writes it out to disk, but before it starts the server, it will look for a script called $ZEUSHOME/web/bin/rewrite. If this script exists, it will be run. This script takes two arguments: the first argument is the name of the virtual server, the second argument is the name of the configuration file. The rewrite program should not be group/world writeable.

This script can then rewrite the file, altering settings such as the IP bind address, document or log file locations that might vary between servers.

E.g.

#!/bin/sh # $1 = vserver, $2 = file # # Rewrites the website name to http://`hostname`:4000/ mv $2 /tmp/z$$ sed "s/^ip_name .*/ip_name `hostname`/;s/^port .*/port 4000/" \ < /tmp/z$$ > $2 rm /tmp/z$$