Node in Production?

20 views
Skip to first unread message

Paul Jungwirth

unread,
Mar 22, 2013, 3:36:33 PM3/22/13
to pd...@googlegroups.com
Hi All,

I was wondering how people are handling deploying and daemonizing
nodejs apps in production? I've googled and read some opinions on
Stack Overflow and various blogs, but I thought I'd ask here also.
Here are some details about my setup:

- I'm running multiple nodejs servers on EC-2 behind an ELB. They are
not public-facing; they service requests from a separate Rails app.

- I'm using Chef to configure each box. In general, my preference is
to use Chef for the box, and Capistrano/ant/etc. for the app, since
the box changes rarely but the app changes a lot. This also lets me
keep the two in separate repos and do faster deploys. But I could be
convinced to use Chef for everything if there are good reasons.

- I'd like a one-liner I can run from my local checkout that deploys
the latest code to all machines, sort of like `cap production deploy`.

- I'd like to be able to deploy to either staging, production, or some
other environment.

- I'd like the deploy command to restart the node server so it picks
up the changes.

Has anyone built something like this? Right now my process is more
like "log on to each box, do a git pull, and restart forever". Any
ideas how I could make that better?

Thanks,
Paul

--
_________________________________
Pulchritudo splendor veritatis.

Ryan Munro

unread,
Mar 25, 2013, 9:53:46 PM3/25/13
to pd...@googlegroups.com, p...@illuminatedcomputing.com
What if you deployed all new VMs for the new code, then just switched the EC2 instances your ELB is pointing at?  That way if your new code breaks something in the surrounding system, your previous state will be unaffected incase you having to roll back to your previous instances.  So you'd probably want 3 commands to do this: create server group, switch ELB, destroy server group.

P.S. Don't do this on Linode, they prorate by the day, not hour.  Making upgrades expensive. :)

Paul Jungwirth

unread,
Mar 27, 2013, 3:56:51 PM3/27/13
to pd...@googlegroups.com
I agree brining up brand-new instances would be a nice way to handle
code deploys. I'm not aware of any existing deployment tools that will
do that for me, so it'd be pushing me further toward building a custom
deployment script.

I did find a Capistrano recipe for deploying Node sites
(https://github.com/loopj/capistrano-node-deploy), but it assumes
you're using upstart.

I might just write my own JS-based Capistrano-like tool. It doesn't
seem that hard.

Thanks again for the reminder that AWS is all about "disposable" computing!

Paul
> --
> You received this message because you are subscribed to the Google Groups
> "Portland JavaScript Admirers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pdxjs+un...@googlegroups.com.
> To post to this group, send email to pd...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/pdxjs/-/OfdZN-6bfuIJ.
> For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages