Tomcat's web server communicates in the HTTP protocol. If the incoming
request doesn't have typical HTTP request headers, then it's not a HTTP
request and Tomcat will not know how to resolve the request. Because
it's not a HTTP request, Tomcat will resolve it to the default host (the
same way apache would if you, for example, telnetted to Apache port 80
and didn't provide any HTTP headers).
The requests from your browser through the load balancers work because
they're communicating using the HTTP protocol. It doesn't sound like
your load balancers are communicating using HTTP.
Are your load balancers capable of performing a HTTP check that will
contain HTTP request headers? IE: a host name and a URI specifically?
Some load balancers are able to take this a step further and check the
content of a response for specific information. Vivio has load balancer
clients that use this feature and have their code run health checks when
their load balancer check point is hit. It's quite useful.
Bottom line, you need to find out exactly what kind of request your load
balancer is sending to your site. If your load balancers can perform a
HTTP check, great. If not, then you will need to configure Tomcat to
respond on the default host.
Warm Regards,
Jordan Michaels
On 02/16/2012 12:33 AM, Brook Davies wrote:
> Hello,
>
> Okay, so hours in and I can't figure this one out. I have a two Railo
> servers setup on windows 2008 with IIS7.5, and they hosts just one
> website (and the admin site):
>
> I've added the entry to server.xml for my site
>
> <Host name="analytics.mywebsite.com <http://analytics.mywebsite.com>"
> appBase="webapps">
> <Context path="" docBase="C:\inetpub\wwwroot\LF-MYWEBSITE\" />
> <Alias>89.34.199.13</Alias> <!--- this is the real server ip -->
> <Alias>89.34.199.57</Alias> <!-- this is the virtual load balanced ip -->
> </Host>
>
> Everything works great, if open a browser and go to the IP or domain, I
> get the website as expected.
>
> The problem is, the load balancer (from loadbalancer.org
> <http://loadbalancer.org>) checks the real ip for a response from a
You said your host was setup as follows:
<Host name="analytics.mywebsite.com" appBase="webapps">
<Context path="" docBase="C:\inetpub\wwwroot\LF-MYWEBSITE\" />
<Alias>89.34.199.13</Alias>
<Alias>89.34.199.57</Alias>
</Host>
But in your logs, I see these IP's:
69.90.199.12
69.90.199.59
69.90.199.58
Is 199.13 an additional load-balanced node?
You indicated 199.57 was the LB IP, but I'm guessing you're referring to
the floating gateway IP? Your networking will be different depending on
how your LB's are set up. From your description, it sounds like you're
using the LB's for both incoming and outgoing traffic.
In this kind of a setup, the floating IP for the LB's will not be seen
by Tomcat. It's used purely for routing.
Try this host config instead.
<Host name="analytics.mywebsite.com" appBase="webapps">
<Context path="" docBase="C:\inetpub\wwwroot\LF-MYWEBSITE\" />
<Alias>89.34.199.12</Alias>
<Alias>89.34.199.13</Alias>
</Host>
... and see if you have better luck.
The values that you add to each <Alias> will be the IP's that the load
balancers hit to perform their checks.
Warm Regards,
Jordan Michaels
> <http://analytics.mywebsite.__com <http://analytics.mywebsite.com>>"
>
> appBase="webapps">
> <Context path="" docBase="C:\inetpub\wwwroot\__LF-MYWEBSITE\" />
> <Alias>89.34.199.13</Alias> <!--- this is the real server ip -->
> <Alias>89.34.199.57</Alias> <!-- this is the virtual load
> balanced ip -->
> </Host>
>
> Everything works great, if open a browser and go to the IP or
> domain, I
> get the website as expected.
>
> The problem is, the load balancer (from loadbalancer.org
> <http://loadbalancer.org>
> <http://loadbalancer.org>) checks the real ip for a response from a
>
> health monitoring script. But the loadbalancer request is getting
> handled differently and instead of:
>
> C:\inetpub\wwwroot\LF-__MYWEBSITE\health\monitor.cfm
>
> its being sent to
>
> C:\railo\tomcat\webapps\ROOT\__health\monitor.cfm
>
> But, I don't understand why, because it should be a normal http
> request
> on port 80 from the load balancer. This is what is in the log:
>
> Page /health/monitor.cfm
> [C:\railo\tomcat\webapps\ROOT\__health\monitor.cfm] not found
> at
> railo.runtime.PageSourceImpl.__loadPage(PageSourceImpl.java:__140):140
> at
> railo.runtime.PageContextImpl.__doInclude(PageContextImpl.__java:759):759
> at
> railo.runtime.listener.__ModernAppListener._onRequest(__ModernAppListener.java:179):__179
> at
> railo.runtime.listener.__ModernAppListener.onRequest(__ModernAppListener.java:83):83
> at
> railo.runtime.PageContextImpl.__execute(PageContextImpl.java:__1991):1991
> at
> railo.runtime.PageContextImpl.__execute(PageContextImpl.java:__1958):1958
> at
> railo.runtime.engine.__CFMLEngineImpl.serviceCFML(__CFMLEngineImpl.java:297):297
> at
> railo.loader.servlet.__CFMLServlet.service(__CFMLServlet.java:32):32
> at
> javax.servlet.http.__HttpServlet.service(__HttpServlet.java:722):722
> at
> org.apache.catalina.core.__ApplicationFilterChain.__internalDoFilter(__ApplicationFilterChain.java:__304):304
> at
> org.apache.catalina.core.__ApplicationFilterChain.__doFilter(__ApplicationFilterChain.java:__210):210
> at
> org.apache.catalina.core.__StandardWrapperValve.invoke(__StandardWrapperValve.java:224)__:224
> at
> org.apache.catalina.core.__StandardContextValve.invoke(__StandardContextValve.java:169)__:169
> at
> org.apache.catalina.core.__StandardHostValve.invoke(__StandardHostValve.java:168):__168
> at
> org.apache.catalina.valves.__ErrorReportValve.invoke(__ErrorReportValve.java:100):100
> at
> org.apache.catalina.valves.__AccessLogValve.invoke(__AccessLogValve.java:929):929
> at
> org.apache.catalina.core.__StandardEngineValve.invoke(__StandardEngineValve.java:118):__118
> at
> org.apache.catalina.connector.__CoyoteAdapter.service(__CoyoteAdapter.java:405):405
> at
> org.apache.coyote.http11.__AbstractHttp11Processor.__process(__AbstractHttp11Processor.java:__964):964
> at
> org.apache.coyote.__AbstractProtocol$__AbstractConnectionHandler.__process(AbstractProtocol.java:__515):515
> at
> org.apache.tomcat.util.net
> <http://org.apache.tomcat.util.net>.__JIoEndpoint$SocketProcessor.__run(JIoEndpoint.java:302):302
> at
> java.util.concurrent.__ThreadPoolExecutor$Worker.__runTask(Unknown
> Source):-1
> at
> java.util.concurrent.__ThreadPoolExecutor$Worker.run(__Unknown