5.3

Table Of Contents
36 vFabric Web Server
36
Configuring vFabric Web Server
Instances
Configure Load Balancing Between Two or More tc Runtime Instances
You can configure a vFabric Web Server instance to perform simple load balancing between two or more tc Server instances.
tc Runtime is the runtime component of vFabric tc Server.
In the procedure that follows, you configure a vFabric Web Server instance to run in front of the tc Runtime instances; this
vFabric Web Server instance receives all requests from users, and then passes them back to the tc Runtime instances using a
specified load-balancing algorithm. Responses from the tc Runtime instances are then routed back through this same vFabric
Web Server instance. For this reason, the vFabric Web Server instance acts like a proxy (both reverse and forward) so that the
users never know the URLs of the backend tc Runtime instance that are actually doing all the work. Additionally, the vFabric
Web Server instance ensures that the load on each tc Runtime instance is balanced. You can specify that each tc Runtime instance
take on an equal work load, or you can specify that one instance work twice as hard as the others.
In the procedure, the following scenario pertains. These assumptions are not requirements; your environment might be very
different. The assumptions are listed only to make the procedure easier to understand.
Two tc Runtime instances are running at the following two hosts and port numbers:
http://192.168.0.203:8081
http://192.168.0.203:8082
The two tc Runtime instances are running on the same computer, are part of the same installation and their respective
CATALINA_BASE variables are as follows:
/var/opt/vmware/vfabric-tc-server-standard/instanceOne
/var/opt/vmware/vfabric-tc-server-standard/instanceTwo
Each tc Runtime instance is configured exactly the same (other than the value of the various ports).
You have deployed the same application to both tc Runtime instances and the URL context is the same in both instances: /
my-app.
You want all users of the application to first go through the front-end vFabric Web Server instance, and any evidence of the
backend tc Runtime instances upon which the application is actually deployed should be hidden from the user.
vFabric Web Server is installed on a different computer than vFabric tc Server. The name of the particular vFabric Web Server
instance is lb-server and its home directory is /opt/vmware/vfabric-web-server/lb-server.
You want to configure sticky sessions, which means that the vFabric Web Server instance always routes the requests for a
particular session to the same tc Runtime instance that serviced the first request for that session.
You want to use the HTTP protocol for all communication between the vFabric Web Server and the tc Runtime instances.
The load balancing described in this procedure is very simple, although you have many options available to further customize
it. At appropriate locations in the procedure, links to the Apache HTTP Server documentation are provided for additional
configuration options not covered by this specific scenario. Adapt the procedure for your particular environment.
As part of the procedure, you update the configuration files of both the vFabric Web Server instance and the two tc Runtime
instances.
Prerequisites
Install vFabric Web Server on your platform and create a new instance.