On 07/05/2010 21:28, Smith, Mark wrote: >> -----Original Message----- >> From: Jon Brisbin [mailto:jon.bris...@npcinternational.com] >> On May 7, 2010, at 1:16 PM, Smith, Mark wrote: >>> Is there a way to tell mod_jk that it has a new worker on a new >>> hostname without having to reload Apache? Similarly, to remove an >>> existing worker that has gone away, or just to change the hostname of a >>> worker. I'm picturing an API on the status worker, or something >>> similar. >>> >>> I don't want to just rewrite workers.properties and do a reload >>> because we have several long uploads happening at any given time that >>> get interrupted. Reload/graceful works most of the time, but >>> occasionally locks up the entire Apache instance, which is no good. >>> >>> I can't imagine we're the first to run into this problem, but I've >>> done a lot of looking and can't find anything other than "rewrite >>> workers.properties and reload Apache." >> >> Reconfig/reload is essentially what I'm doing too, though I use >> mod_proxy_ajp rather than mod_jk. >> >> But the annoying thing is that you're absolutely right you're not the >> first and it's frustrating knowing it'll be a while until enough >> developers have a handle on cloud architectures to make meaningful >> contributions to projects to address these fundamental problems. > > Ok, so the silver lining here is that I'm not a complete buffoon who just > doesn't know how to use Google to find the solution; there are, in fact, > others with the same problem. That's a plus... :-) > >> [...] To be honest, I'm seriously looking at using >> ipchains or something to do NAT on the box and cut out Apache entirely. > > I thought about this. The problem is that you want DNAT to change the > destination of your outgoing packets, but DNAT is only a valid target in > PREROUTING which only gets hit when receiving packets. SNAT is valid in > POSTROUTING on the outgoing side, but doesn't help you with this problem. > > I have this at the top of all my IPTables files; feel free to use it. > > ----- snip! ----- > ############# > # For Reference > ############# > # Packets traversal through netfilter: > # > #in -> (nat ) -> [routing ] -> (FORWARDING) -> (nat ) -> out > # (PREROUTING) [decision] (POSTROUTING) > # || /\ > # \/ || > # (INPUT) (nat OUTPUT) > # || /\ > # \/ || > # [local ] -----------------> (OUTPUT) > # [process] > ----- snip! ----- > > Another option is to configure mod_jk for static hostnames then use either > /etc/hosts or an actual DNS cluster to change the mappings. This relies on > the application in question honoring DNS TTLs (hint: Java doesn't by > default). The good news is, it appears that mod_proxy_balancer at least > honors /etc/hosts. > > This is actually my current favorite option, but it just seems like a grand > hack, and it doesn't allow me to _ADD_ hosts to the config, only change them. > So I'm likely to configure a large number of workers who will not be running > most of the time, let the auto-scaling system make the workers work or > not-work as it brings instances up and down, and accept the restart of Apache > when I have to increase the max number of workers. > > It's not pretty, but it looks like it'll work. > >> Or even writing my own proxy server from scratch. I hate that I keep >> coming back to that so often lately. I just get frustrated, throw up my >> hands, and resign myself to simply doing it myself. I lamented on this >> very topic yesterday to The 451 Group when we talked about cloud >> architectures etc... > > I guess that's why we all like Open Source: Code doesn't do what you want it > to? Make it do it! ;-) > > I've considered modifying mod_jk or mod_proxy_balancer to add this > functionality, but don't have the resources to do that just yet.
Cheap & dirty. 1. pre-configure each load balancer with a list of disabled workers: <Proxy balancer://mycluster> BalancerMember http://tomcat01.mynet.internal:8009 BalancerMember http://tomcat02.mynet.internal:8009 BalancerMember http://tomcat03.mynet.internal:8009 # ... BalancerMember http://tomcat99.mynet.internal:8009 status=D </Proxy> 2. update the hosts file on the load balancer to assign your newly created virtual server IPs to one of the fake domain names above 3. enable the no-longer-a-dummy host using the /balancer-manager URLs A variation on this will probably work for mod_jk, it might even work better. p > -Mark > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org >
signature.asc
Description: OpenPGP digital signature