6

I don't use AJP for load-balancing; I have a single Apache 2.2 instance that proxies some URLs to a single Tomcat 7 instance via AJP.

When Tomcat is down, the AJP proxy becomes disabled on the first failed request, and is not re-enabled when Tomcat is brought back up.

Is it possible to instruct Apache to not disable AJP connection, even though the backend is down, so that the proxy starts working the moment the backend is back online?

Here's an excerpt from my httpd.conf:

ProxyPass /my-web-app ajp://localhost:8009/my-we-app-1.0.2

And here's the log file when the backend is down:

[error] (OS 10061)No connection could be made because the target machine actively refused it.
[error] ap_proxy_connect_backend disabling worker for (localhost)
[error] proxy: AJP: failed to make connection to backend: localhost
rustyx
  • 1,506
  • 3
  • 19
  • 28

1 Answers1

8

Sure; instruct Apache to never wait to retry that backend connection (it's waiting 60 seconds, by default) with retry=0:

ProxyPass /my-web-app ajp://localhost:8009/my-we-app-1.0.2 retry=0
Shane Madden
  • 112,982
  • 12
  • 174
  • 248
  • 1
    Awesome, that's what I needed, thanks. Never tried waiting >60 seconds, too impatient for that :D – rustyx Jan 13 '12 at 19:31