3. Using Apache HTTP Server for load-balancing

Using Apache HTTP server as a front-end to load-balance a cluster of Servoy Application Servers is optional. You should be able to do this in other ways, including custom balancing inside a Tomcat instance application or using other HTTP servers such as IIS that support (or have modules for) AJP1.3. Read through the section even if you do not plan to use Apache HTTP Server as it also shows configuration changes needed for Servoy Application Servers to run in a similar setup.

Smart clients will connect directly to the individual Servoy Application Servers in the cluster. The load-balancing is done by serving the JNLP file from different servers when the Apache HTTP front-end is accessed. Add to each of the Servoy Application Server's "servoy.properties" files the following line (needed for Smart Client load balancing):

servoy.jnlpCodebaseOverride=http://thisServersHostnameAsSeenByClients:port

What you should also take into consideration when setting up a load-balanced cluster, is allowing smart-clients to connect directly to individual servers in the cluster. This means that all Servoy Application Servers should be accessible from the client side - and you might want to isolate the cluster so that connections to ports used by Terracotta (see tc-config.xml) are only allowed from within the cluster, even if connections from client machines on Servoy ports should be allowed to all Servoy Application Servers.

3.1 Configure Apache HTTP Server

You have a possibility to monitor and control worker activity by uncommenting the "jkstatus" related comments in *worker.properties* and *httpd.conf* and accessing "_\[randd:yourServerUrl\]/jkmanager/_". This page will also allow you to activate/disable workers. You should add a worker for each Servoy Application Server that you will possibly start in your cluster, even if you do not plan to have them started all at once. There is no problem if only a part of those Servoy Application Servers are started. Load-balancing will work on servers defined in the *worker.properties* file that are also available. If you do define workers for Servoy Application Servers that are not started, disable them from the jkmanager page in order to avoid delays caused by load-balancer trying to check the availability of these workers.

3.2 Configure each Servoy Tomcat Server in the cluster to work with the AJP 1.3 connector

This will describe how to set up the two Tomcat Servers in your Servoy installations as used by original worker.properties file above. You can adapt it when using more Servoy installations.

When you start the 2 Servoy Application Servers and the Apache HTTP server and you access the Apache HTTP server you will be automatically using one of the two Servoy Servers in a weighted round-robin load balancing with sticky sessions manner.