For zero downtime I use a hand-crafted cluster based restarter. It's very much like recluster (on npm) though, so I recommend using that instead.
Basic process is install the new code, give the process SIGUSR2, and it reaps the children one by one and restarts them (using cluster's disconnect() method, so it won't restart until the child stopped processing all connections). You only need a full-blown restart if you change recluster, which is super-rare. https://www.npmjs.org/package/recluster On Tue, Jun 24, 2014 at 10:00 AM, henrique matias <[email protected]> wrote: > I'm really interested in any way zero downtime deploys could happen. > > > Regarding switching between versions of the app: > > Recently a friend of mine ( necker at gibhub ) introduced me to Thalassa > and Aqueduct: > > In short: > > - Aqueduct will connect to an haproxy instance and dynamically update / > refresh the configuration > > - Your node application register itself with Aqueduct, saying which > version of the app it is running > > - You have a GUI to see which applications have been registered, which > are running, and also switch between different versions of your app > > Long version: https://www.youtube.com/watch?v=k6QkNt4hZWQ > > Seems pretty cool. > > > Is anyone running this kind of "load balancer" management system? Any > recommendations ? > > > > > > > > > > On 13 June 2014 14:18, Will Hoover <[email protected]> wrote: > >> If your using Grunt/GitHub another option would be >> https://www.npmjs.org/package/releasebot >> The next release will have option to bundle dependencies in released >> assets. >> >> -----Original Message----- >> From: [email protected] [mailto:[email protected]] On Behalf >> Of Sam Roberts >> Sent: Thursday, June 12, 2014 6:40 PM >> To: [email protected] >> Subject: Re: [nodejs] Deployment techniques >> >> There's a bit of a rough consensus on how to deploy, see some of these >> info sources: >> >> - [The npm Debacle Was Partly Your >> Fault](http://www.letscodejavascript.com/v3/blog/2014/03/the_npm_debacle) >> - [Heroku Buildpack >> README]( >> https://github.com/heroku/heroku-buildpack-nodejs/blob/master/README.md) >> Good even if you don't use heroku. >> - [10 steps to nodejs nirvana in >> production](http://qzaidi.github.io/2013/05/14/node-in-production/) >> - <http://addyosmani.com/blog/checking-in-front-end-dependencies/> >> - <http://www.futurealoof.com/posts/nodemodules-in-git.html> >> >> >> Basically, it comes down to bundling as much as possible during build, so >> you have no deploy-time dependencies on external resources, and you deploy >> the same thing, every time. >> >> There is some debate on compiled dependencies, building them means no >> need for a compiler on your deploy servers... but you need same build env >> as deploy. Pros and cons both ways. >> >> Where it gets heated is how do you transport your app? tarball works ok >> for some, in which case bundling your dependencies and doing an npm pack >> works OK, but you have to get the .npmignore file correct, as well. >> >> Also, lots of the above suggest commiting your build deps to git... I did >> that for fun for a loopback app that had an angular front-end, used bower, >> your basic full-stack node app. Over a million lines went into the git >> commit... craziness. And then there are all the command line shannanigans >> to keep it up to date, and modify your .gitignore. >> Doing this on a development tree doesn't make any sense to me. >> >> And, its unnecessary with git, you can use git commit-tree to keep an >> exact source copy of your development HEAD in a deploy branch, and THEN add >> the build products. This allows robust git push to PaaS deployment, but it >> also allows you to do an npm pack from completely git controlled state, to >> tag, to rollback, etc. All the good things you get with git, minus the pain >> of your dependencies in your dev tree. >> >> One problem with all this advice is it takes a pretty ad-hoc set of tools >> to do it all. Lots of steps are manual or script-it-yourself, or when >> scripted, are a bit creeky (bundle-deps doesn't bundle optional >> dependencies, for example). >> >> Anyhow, I've been working a tool to do the client-side build part of >> this, encapsulating what I think is the mostly-consensus best way to do >> these things, and some extras like git commit-tree. Its in pre-release, >> which means get it from https://github.com/strongloop/strong-build until >> its npm published. >> >> When you run it, you'll find the steps can be run one-by-one, or all >> together, are reasonably customizable, and log all the git, npm, and shell >> commands they execute to make it as transparent as possible about what its >> actually doing to your source. >> >> I'd love to have some feedback if you give it a whirl. >> >> Cheers, >> Sam >> >> -- >> Job board: http://jobs.nodejs.org/ >> New group rules: >> https://gist.github.com/othiym23/9886289#file-moderation-policy-md >> Old group rules: >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines >> --- >> You received this message because you are subscribed to the Google Groups >> "nodejs" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/nodejs/CACmrRmQtVO%3DBw5oNmTdooHJcNmyExqV%2BcJp4uVTuE7ok%2ByCJFw%40mail.gmail.com >> . >> For more options, visit https://groups.google.com/d/optout. >> >> -- >> Job board: http://jobs.nodejs.org/ >> New group rules: >> https://gist.github.com/othiym23/9886289#file-moderation-policy-md >> Old group rules: >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines >> --- >> You received this message because you are subscribed to the Google Groups >> "nodejs" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/nodejs/539afa0a.0743ec0a.641b.5166%40mx.google.com >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- > Job board: http://jobs.nodejs.org/ > New group rules: > https://gist.github.com/othiym23/9886289#file-moderation-policy-md > Old group rules: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > --- > You received this message because you are subscribed to the Google Groups > "nodejs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/nodejs/CA%2BoarRJo28A6j1ZH2B3_gw8bNfbxW%3D31OyT6ZvBx_PmUGM6b6w%40mail.gmail.com > <https://groups.google.com/d/msgid/nodejs/CA%2BoarRJo28A6j1ZH2B3_gw8bNfbxW%3D31OyT6ZvBx_PmUGM6b6w%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CAPJ5V2b3%3DD_uLhpm0u6U-ZOMx9QtEsc3B3jYu-L6%2BKWvcBjPdg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
