WebApp Load Balancing Demo =========================== Demonstrates balancing load acoss SCA services by deploying an SCA composite to two tomcat servers in a cluster. The tomcat servers sit behind an Apache server which directs load to one or other tomcat server based on a set of rules. The mvn pom distributed with this sample will download, install and configure two Tomcat servers automatically to act as workers. You need to install the Apache web server and configure it manually. 1 - Install and configure the Tomcat workers mvn This results in two tomcat servers at target/tomcat-8085 target/tomcat-8086 2 - Install and configure the Apache server to balance load In this case we've chosen to use the native JK connector. There are several resources that tell you how to configure Apache for load balancing Tomcat with the JK connector. For example, http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html http://www.crazysquirrel.com/computing/debian/servers/tomcat55.jspx Here is a high level summary Download the latest version of Apache 2.2 (this demo was built with Apache 2.2.6) http://httpd.apache.org/ Install in a local director called, say, apache Download the mod_jk module (in binary form if you can) http://tomcat.apache.org/download-connectors.cgi Install it in apache/modules Configure the mod_jk module Copy src/test/resources/apache-80/conf/workers.properties to apache/conf Append the contents of src/test/resources/apache-80/conf/httpd.conf to apache/conf/httpf.conf 3 - Start the apache and tomcat servers In three command prompts cd target/tomcat-8085 bin/catalina run cd target/tomcat-8086 bin/catalina run cd apache bin/httpd 4 - Run the client run the LanchClient program - TBD - need a script 5 - Result The client will make 10 calls to the SCA service described in the helloworldws.composite that is part of the webapp deployed to the tomcat servers. You will see the result of this service call reported at the client in the form Called getGreetings Hello World 6 If you look at the Tomcat consoles you will see that each server deals with half the requests as the load is balanced equally between the two of them.