Hi, I am a newbie and need to setup a load balancing setup where apache will distribute load between 2 or 3 tomcats(each tomcat resides on a different machine) based on a parameter coming in the URL. Based on that parameter I have to carry on some logic and implement an algorithm in java and then send that request to the corresponding tomcat. Can anyone explain how to do that. For eg. I have unique Id coming in as the URL parameter. The tomcat installed in each machine has a DB which can only allow a range of that ID. So I want to apply the logic on the apache(either by some reg ex or implementing some load balancing class of apache) such that the ID belonging to the particular machine is routed to that machine. Please help??
Also use one server as a Load Balancer which will forward the requests as per your login to the remaining 3 servers hosting your website/application. This will ease out a little bit of complications.