This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Servlets and the fly likes accessing info from multiple web servers being a load balancer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "accessing info from multiple web servers being a load balancer" Watch "accessing info from multiple web servers being a load balancer" New topic
Author

accessing info from multiple web servers being a load balancer

Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
We're moving our setup from a single standalone Tomcat machine to multiple ones behind a BigIP load balancer. We have a custom administration context to access some info regarding our webapp (which means we can type in a URL to a JSP that's displaying this info that we can refresh as frequently as we want). I know the answer will not necessarily be related to servlets, but I wasn't sure where else to post, and what we're doing here is trying to figure out how to access this info that we currently get through servlets/JSPs after we move to the new setup.

So, right now, if we're back at the office and want to view the page, we just go to www.oursite.com/administrator/OurCustomPage.jsp to view the stats. However, the load balancer will send our IP address to only one of the web servers, and it will continue to keep sending us to just that one--there's no way to specify which web server we want to go to, and that load balancer is locked down tight (they don't want to do much custom stuff for security's sake), and there's no VPN up at the data center so we can't just get onto the VPN and then access that webpage on each web server's private IP address.

I don't have much experience writing "raw" client/server programs in Java, but I guess it might not be that hard. I've thought of writing a simple program that can run on each web server and load up that page and parse the data there and then get that info over to us fairly regularly, but I was wondering if there was a way to get that simple program to communicate directly with the J2EE objects running on the server (simple JavaBean objects, not EJBs). The JSP just displays info that's loaded into a bean, so if I could have a simple outside Java program get to that bean somehow, it seems like that might be a better way to go. Do you have to use RPC even if it's on the same machine? I don't have any experience with that, but if it's the only way to do it, then I can read up on it...
 
GeeCON Prague 2014
 
subject: accessing info from multiple web servers being a load balancer