On 23/11/2011 06:37, Faseela K wrote:
> 
> Hi,
> 
> I have applications running on two tomcat servers which are in load balancing 
> mode.

OK so far.

> If I try to access the application from the first server,and if the request 
> is forwarded to the second server,
> the request.getRemoteAddr() on the second server still returns 
> "127.0.0.1"(instead of first server IP).

So server #1 connects to the load balancer?

On which server is the load balancer?


> If the client is outside the two loadbancing servers, I am getting the proper 
> client IP address.

Sounds like the application is working properly then.


> I am using tomcat 5.5.31 and mod_jk module for load balancing,and my platform 
> is solaris 10.
> Is there a way to get the actual client IP,rather than localhost,if the 
> client is on the same box as the tomcat server,and if the request is 
> forwarded to the second load balancing server?

If the client is on the same physical server as the Tomcat, then the
correct IP address *is* 127.0.0.1.

Your networking stack may well identify that it's a local operation &
bypass the time-consuming roundtrip through the network device, just
doing a shorter in-memory operation via the loopback address.


p



> 
> Thanks,
> Faseela
> 
> 


-- 

[key:62590808]

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to