URL Mappings


Introduction
URL mapping is a powerful feature of the Zeus Load Balancer that enables particular web pages to be delivered by a specific machine in the cluster. This gives even greater control over the workload of each individual web server. Also, it enables clustering of websites where most of the content can be provided by all servers, but some specific areas must be handled by one machine.

Mapping works as follows: You specify a list of regular expressions, together with the backend webserver that will deliver all URLs that match that regex. This list should be written to the file $ZEUSHOME/balancer/mappings and must be copied to each Balancer that is running. The mappings can be altered whilst the Balancer is still running - it will notice that the file has changed and reload the mappings as appropriate.

Syntax

<backend machine> <regular expression>

with one regular expression per line. Blank lines and comments are allowed (comments are lines that begin with #).

Note that the regular expressions are only matched against the 'file' part of each URL. So, if a browser requests the page http://www.cluster.zeus.co.uk/foo/bar.html, the text '/foo/bar.html'is checked against all the regular expressions given.

For example, a valid mappings file could be:

   # Map all image files to backend server 'mercury'
   mercury .*\.(gif|jp[e]g)

   # Everything in /products and subdirectories goes to backend 'venus'
   venus ^/products/

Some important points to note

Troubleshooting
After creating the mappings file, wait a few seconds to ensure that the Balancer detects that the file has changed, then check the error log of the Load Balancer. If there are any problems with the regular expressions or the syntax used in the file, the Balancer will report them. The error log is $ZEUSHOME/balancer/log/errors