Hi, I'm just curious if we will be able to add handlers without restarting mongrel2.
You cannot add or remove handler specs at runtime (at the moment) but you can add/remove handler backends however you like. This is due to the distributed nature of zmq. On 1 Sep 2010 08:18, "Carlo Pires" <carlopires@gmail.com> wrote: > Hi, > > I'm just curious if we will be able to add handlers without restarting mongrel2.
On Wed, Sep 01, 2010 at 08:21:40AM +1000, joshua simmons wrote: > You cannot add or remove handler specs at runtime (at the moment) but you > can add/remove handler backends however you like. This is due to the > distributed nature of zmq. > > On 1 Sep 2010 08:18, "Carlo Pires" <carlopires@gmail.com> wrote: > > Hi, > > > > I'm just curious if we will be able to add handlers without restarting > mongrel2. Also it depends on what you mean by "at runtime". If you mean this: "The developer creates an application that adds and removes routes on the fly whenever he feels like it so that nobody in operations can ever figure out where something is going. Then he goes on vacation." Then no that'll never happen unless someone goes out of their way to hack it up. If you mean: "I'm working on my application and I haven't really got my configuration routes right yet, so I want to reload them as I work." Then yeah it supports it now, but through signals. Just hit it with SIGHUP and it reloads. We could probably add that easily as a command to the control port too. The main thing though is changing routes on the fly is evil as hell. Operations will absolutely hate an app that does that since it's impossible to maintain and predict. Also, it's kind of not Mongrel2's job to be honest. My vision is that Mongrel2's routes are like 1 level above your application's routes, being just enough to figure out where a request goes and then leaves it to your app framework to do the real logic. Hope that makes sense. -- Zed A. Shaw http://zedshaw.com/
With SIGHUP signaling mongrel2 reloads config.py ? 2010/8/31 Zed A. Shaw <zedshaw@zedshaw.com>: > On Wed, Sep 01, 2010 at 08:21:40AM +1000, joshua simmons wrote: >> You cannot add or remove handler specs at runtime (at the moment) but you >> can add/remove handler backends however you like. This is due to the >> distributed nature of zmq. >> >> On 1 Sep 2010 08:18, "Carlo Pires" <carlopires@gmail.com> wrote: >> > Hi, >> > >> > I'm just curious if we will be able to add handlers without restarting >> mongrel2. > > Also it depends on what you mean by "at runtime". If you mean this: > > "The developer creates an application that adds and removes routes on > the fly whenever he feels like it so that nobody in operations can ever > figure out where something is going. Then he goes on vacation." > > Then no that'll never happen unless someone goes out of their way to > hack it up. > > If you mean: > > "I'm working on my application and I haven't really got my configuration > routes right yet, so I want to reload them as I work." > > Then yeah it supports it now, but through signals. Just hit it with > SIGHUP and it reloads. We could probably add that easily as a command > to the control port too. > > The main thing though is changing routes on the fly is evil as hell. > Operations will absolutely hate an app that does that since it's > impossible to maintain and predict. Also, it's kind of not Mongrel2's > job to be honest. My vision is that Mongrel2's routes are like 1 level > above your application's routes, being just enough to figure out where a > request goes and then leaves it to your app framework to do the real > logic. > > Hope that makes sense. > > -- > Zed A. Shaw > http://zedshaw.com/ >
On Wed, Sep 01, 2010 at 09:11:16AM -0300, Carlo Pires wrote: > With SIGHUP signaling mongrel2 reloads config.py ? Actually try this: m2sh load -db config.sqlite -config config.py m2sh reload -db config.sqlite -every That should wire up your new config and send all your servers the SIGHUP so they reload. Your config.sqlite will need to be in the chroot of the servers though, but should work. -- Zed A. Shaw http://zedshaw.com/
m2sh reload -db config.sqlite -every failled with the message: TypeError: reload_command() got an unexpected keyword argument 'every'
On Wed, Sep 01, 2010 at 07:30:00PM +0200, fokenrute wrote: > m2sh reload -db config.sqlite -every failled with the message: TypeError: > reload_command() got an unexpected keyword argument 'every' Fancy, well try -name or -host like in start, stop, running, etc. I'll fix that shortly. -- Zed A. Shaw http://zedshaw.com/
m2sh reload -db conf/config.sqlite -host localhost gives: ERROR: PID file /var/www/mongrel2/run/mongrel2.pid not found. I don't know if it's significant, but I run m2sh as root
On Wed, Sep 01, 2010 at 10:16:48PM +0200, fokenrute wrote: > m2sh reload -db conf/config.sqlite -host localhost gives: ERROR: PID file > /var/www/mongrel2/run/mongrel2.pid not found. > > I don't know if it's significant, but I run m2sh as root We tend to say "ERROR" when we sometimes we mean WARN. In the 2.0 version we'll make those more like WARNs but basically if it keeps going then you're good. Also, it's better to not run m2sh as root. We've designed mongrel2 so that you stop being root and go with a sudo setup. Everything just works so much cleaner and safer when you do this. With reload it's fine since it should be running as the user you are, so you're set. With start you have an option -sudo which will run the mongrel2 binary with sudo to get it started. What I usually do is: m2sh start -db config.sqlite -every To test my configs out, so it stays in the foreground and runs as my user, then: m2sh start -db config.sqlite -every -sudo So that it runs initially as root, then drops priv after chrooting. The awesome part of this whole setup, and the piece you'll thank me for later, is that you can then replicate your config to other machines in a snap. Everything's contained in one directory and not owned by root, so it'll run all over. I do this all the time and it's great. No need to hunt around for random files all over. I can check it all into git or hg. It's lovely. :-) -- Zed A. Shaw http://zedshaw.com/
I changed the owner of all the stuff under /var/www/mongrel2 to www-data.users and upgraded to 1.0rc1. When I do: m2sh start -db /var/www/mongrel2/conf/config.sqlite -every -sudo, I get the same error than before.
On Wed, Sep 01, 2010 at 10:55:17PM +0200, fokenrute wrote: > I changed the owner of all the stuff under /var/www/mongrel2 to > www-data.users and upgraded to 1.0rc1. > When I do: m2sh start -db /var/www/mongrel2/conf/config.sqlite -every -sudo, > I get the same error than before. Did you see my other message about changing your config? You have access_log="/log/access.log" error_log="/log/error.log" But it needs to be "/logs/" <--- "/logs" (with an 's') not "/log". The 1.0 release will fix that. Refer to this email: http://librelist.com/browser//mongrel2/2010/9/1/mongrel2-says-he-can-t-read-the-pid-file/#59e0ab69570e162389eae46d7b818f1f -- Zed A. Shaw http://zedshaw.com/
No, it will reload the database. You have to manually update config.sqlite from config.py On 1 Sep 2010 22:11, "Carlo Pires" <carlopires@gmail.com> wrote: > With SIGHUP signaling mongrel2 reloads config.py ? > > 2010/8/31 Zed A. Shaw <zedshaw@zedshaw.com>: >> On Wed, Sep 01, 2010 at 08:21:40AM +1000, joshua simmons wrote: >>> You cannot add or remove handler specs at runtime (at the moment) but you >>> can add/remove handler backends however you like. This is due to the >>> distributed nature of zmq. >>> >>> On 1 Sep 2010 08:18, "Carlo Pires" <carlopires@gmail.com> wrote: >>> > Hi, >>> > >>> > I'm just curious if we will be able to add handlers without restarting >>> mongrel2. >> >> Also it depends on what you mean by "at runtime". If you mean this: >> >> "The developer creates an application that adds and removes routes on >> the fly whenever he feels like it so that nobody in operations can ever >> figure out where something is going. Then he goes on vacation." >> >> Then no that'll never happen unless someone goes out of their way to >> hack it up. >> >> If you mean: >> >> "I'm working on my application and I haven't really got my configuration >> routes right yet, so I want to reload them as I work." >> >> Then yeah it supports it now, but through signals. Just hit it with >> SIGHUP and it reloads. We could probably add that easily as a command >> to the control port too. >> >> The main thing though is changing routes on the fly is evil as hell. >> Operations will absolutely hate an app that does that since it's >> impossible to maintain and predict. Also, it's kind of not Mongrel2's >> job to be honest. My vision is that Mongrel2's routes are like 1 level >> above your application's routes, being just enough to figure out where a >> request goes and then leaves it to your app framework to do the real >> logic. >> >> Hope that makes sense. >> >> -- >> Zed A. Shaw >> http://zedshaw.com/ >>