tags:

views:

224

answers:

1

I have an existing web application built in .Net, running on IIS that leverages a java servlet that we have running on Tomcat 5.5. We need to scale the application and I'm confused about what relates to our situation and what we need to do to get the servlet running on multiple servers.

Right now I have 4 servers that can each individually process results, it almost seems like all I should have to do is add the ajp13 worker processes from three additional machines to the machine hosting the load balancer worker. But I can't imagine it should be that easy.

What do I need to do to distribute the Tomcat load to the extra three machines?

Thanks.

Update: The current configuration is using a workers2.properties configuration file. From all of the documentation online I have not been able to determine the distinction between the workers.properties and the workers2.properties. Most of the examples that I have found are configuring the workers.properties and revolve around adding workers and registering them in the worker.list element. The workers2.properties does not appears to have a worker.list element and the syntax is different enough between the workers.properties and the workers2.properties that I'm doubtful that I can add that element. If I just add my multiple AJP workers to the workers2.properties file do I need to worry about the apparent lack of a worker.list element?

[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
group=lb

[ajp13:host2.mydomain.local:8009]
channel=channel.socket:host2.mydomain.local:8009
group=lb

[ajp13:host3.mydomain.local:8009]
channel=channel.socket:host3.mydomain.local:8009
group=lb

A couple of side notes... One I've noticed that sometime Tomcat doesn't seem to reload my changes and I don't know why. Also, I have no idea why this configuration has a workers2.properties and not a workers.properties. I've been assuming that it's based on version but I haven't seen anything to back up that assumption.

A: 

I suppose that you are using isapi_redirect.dll to connect IIS with Tomcat and that you are following steps similar to [these] or these[1].

You would then have a workers.properties file. You can edit that to add more than one workers:

worker.list = tomcat-worker1, tomcat-worker2, tomcat-worker3
worker.tomcat-worker1.type = ajp13
worker.tomcat-worker1.host = host1
worker.tomcat-worker1.port = 8009
worker.tomcat-worker2.type = ajp13
worker.tomcat-worker2.host = host2
worker.tomcat-worker2.port = 8009
worker.tomcat-worker3.type = ajp13
worker.tomcat-worker3.host = host3
worker.tomcat-worker3.port = 8009

You also need to edit the server.xml of each tomcat to enable the AJP connector.

If you don't need sticky sessions, this is all that is needed. If your servlet uses a session, then you need to make sure that all requests belonging to the same session are redirected to the same Tomcat worker. I am afraid that I can't help you with this.

kgiannakakis