tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Faseela K <faseel...@ericsson.com>
Subject RE: Query related to detection of the Source IP Address in Load-balancing mode
Date Thu, 24 Nov 2011 07:01:02 GMT
Hi,

  The client is on the same physical server(Server #1) as the Tomcat,
  but the load balancer decides that the request is to be processed by Server #2.
  Then,in Server #2,I see _request.getRemoteAddr() returns 127.0.0.1.(though the request came
from Server #1).That is the issue.


Thanks,
Faseela 

-----Original Message-----
From: Pid [mailto:pid@pidster.com] 
Sent: Thursday, November 24, 2011 1:08 AM
To: Tomcat Users List
Subject: Re: Query related to detection of the Source IP Address in Load-balancing mode

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]


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message