Tim Funk wrote:

I'm not sure of the status so far, but I'd like to summarize a strawman. I have no idea how to code this at this time or if it can be done.

No problem, we drill down into the details as we go along :)

*Config* [Feel free to change the names]
ProxyClient http://server1/config.xml
ProxyClient http://server2/config.xml
ProxyClient http://server3/another/config.xml
ProxyUpdate /proxyconfig

The config should follow the established config for proxy, which would be this:

ProxyPass /myWebapp ajp://server1/myWebapp

At the moment, "server1" would resolve to multiple names, however a userful addition would be ability to do this:

ProxyPass /myWebapp ajp://server1 server2 server3/myWebapp

which is the way LDAP URLs handle multiple possible servers.

*Startup*
Apache polls each proxy-client for existence and config at the URL defined by te ProxyClient directive.
Each proxy-client states the paths/extension/mimetype/??? it can serve as well as its "weight".

It is the job of proxy_ajp to understand what "ajp://server1 server2 server3/myWebapp" means.

What proxy_ajp can do, if it has not already done so, is poll the servers in the server list and say "hey guys, which of you lot serves myWebapp? All of you? Ok cool bananas - the top of the list of IPs I have been given is you server1, so go ahead, knock yourself out".

*On going*
Apache periodically polls the config URL for changes.
--or--
A proxy-client can join, remove, alter URL availability by using making a
request to apache defined at ProxyUpdate.

proxy_ajp need not poll - it can do so as the request arrives.

If proxy_ajp connects to the backend, and that backend returns 5xx, then proxy_ajp says "Oops, obviously not serving any more, let me try the next IP in my list and see if that one is willing to serve my request".

*Edge cases*
Authentication, environment variables, and other system parameters would be
passed to the proxy via X-Headers. Apache would need to deny/filter these header names from outside clients.

I don't understand - are these headers created by tomcat, and passed towards the client, or created by the client, and passed towards tomcat?

Either way, funky header handling would be done by proxy_ajp.

*stickyness*
unknown how to fix this in a generic manner

Using a completely separate and independant module called "proxy_sticky", which uses a hook I will be putting into proxy sometime this weekend. :)

*Failover* 2 cases
1) server unavailable - easy to recover since a new connection is made
2) server available but doesn't handle request anymore -
    Proxy-client returns a custom header to let apache move to next node?

No need for a custom header - just interpret the response codes correctly. 5xx means try the next server in the list, if you run out of list, pass the error back up to the client.

Regards,
Graham
--

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature



Reply via email to