Reputation: 434
My application (deployed in tomcat) got two wars, a client (say A) and a server (say B). Both of them are deployed in same jvm, and they commnicate via web service. Now in order to make the application scalable, I want this to be clustered and deployed in multiple nodes. Following is the load balancer configuration in apache server.
<Proxy balancer://mycluster stickysession=JSESSIONID>
BalancerMember ajp://127.0.0.1:8009 min=10 max=100 route=jvm1 loadfactor=1
BalancerMember ajp://127.0.0.1:8019 min=20 max=200 route=jvm2 loadfactor=1
</Proxy>
ProxyPass /A balancer://mycluster/A
ProxyPass /B balancer://mycluster/B
In my client application, server url is provided like below
server.url=http://localhost/B/myservice/
My intention is that any request reaching web app A on a node should get processed in web app B on same node. But with the current configuration,its not giving intended result. Request processed in web app A on jvm1 goes to web app B on jvm2 and vice versa. Please let me know what I'm missing here and how could I get rid of the problem
Upvotes: 0
Views: 1687
Reputation: 2505
The behaviour you observe seems reasonable: You send a request to your Apache load balancer, and it gets routed to one of the nodes. If I understand your scenario right, you want to force the request (initiated by your web app) to be routed to the correct node. I can think of two ways to achieve this:
BTW: Your configuration looks as if both nodes and the load balancer run on a single machine. Sure about that?
Upvotes: 1