Deploy Meteor on Amazon EC2 (or your own server)

1,475 views
Skip to first unread message

Julien Chaumond

unread,
Oct 26, 2012, 5:15:56 AM10/26/12
to meteor-talk
I didn't find much content around on this subject, so I've written
down some notes on how to deploy a Meteor app on EC2 (or your own
server) here: http://julien-c.fr/2012/10/meteor-amazon-ec2/

I've also included a link to an Ubuntu 12.04-based Meteor AMI if
needed.

Performance-wise, we deployed Sacha Greif's sidebar.io to a small EC2
instance yesterday. After a while under moderate traffic, we encounter
the same CPU locking problem described in other threads, but
restarting node periodically seems to help for now.

Julien

Dror Matalon

unread,
Oct 26, 2012, 5:52:32 AM10/26/12
to meteo...@googlegroups.com
Nice write up.

Didn't you need to install fibers?

Also, how much is moderate traffic? Did you use a tool, and at what
point did you see issues with a small instance?

Dror
> --
> You received this message because you are subscribed to the Google Groups "meteor-talk" group.
> To post to this group, send email to meteo...@googlegroups.com.
> To unsubscribe from this group, send email to meteor-talk...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/meteor-talk?hl=en.
>

Gabriel Pugliese

unread,
Oct 26, 2012, 11:40:40 AM10/26/12
to meteo...@googlegroups.com
Many thanks! :)
--

Gabriel Pugliese
@gabrielsapo
+55 11 9-9374-2720
http://www.blogcloud.com.br

Julien Chaumond

unread,
Oct 26, 2012, 11:52:10 AM10/26/12
to meteo...@googlegroups.com
Didn't you need to install fibers?

No, but should I? 

Also, how much is moderate traffic? Did you use a tool, and at what
point did you see issues with a small instance?

Traffic was about 100 concurrent connections. 

I just used `top` to monitor node's CPU load. Haven't had a chance to look at node profiling yet :) 

Julien

Dror Matalon

unread,
Oct 26, 2012, 1:58:37 PM10/26/12
to meteo...@googlegroups.com
The meteor README says that you need to, but more important, I got an
error trying to run "node.js main" without installing it.

It was actually, a little bit of a pain to install it, and I had to
get it from source. Unfortunately, I didn't keep notes of the details.

This is all on EC2 on an ami-d70c2892, Ubuntu 12.04.

Julien Chaumond

unread,
Nov 2, 2012, 7:59:52 AM11/2/12
to meteo...@googlegroups.com
If you run your bundle on the platform you created it on, you shouldn't have to do that.

Julien

Dror Matalon

unread,
Nov 2, 2012, 3:01:33 PM11/2/12
to meteo...@googlegroups.com
That's not my experience. On a vanilla install of ubuntu on ec2, I get
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: `/home/dror/tmp/bundle/server/node_modules/fibers/bin/linux-ia32-v8-3.7/fibers.node`
is missing. Try reinstalling `node-fibers`?
at Object.<anonymous>
(/home/dror/tmp/bundle/server/node_modules/fibers/fibers.js:13:8)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:32)
at Function._load (module.js:308:12)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at Object.<anonymous> (/home/dror/tmp/bundle/server/server.js:3:1)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)

node v0.6.12

So I'm curious how you have fibers working without installing it explicitly.

David Glasser

unread,
Nov 2, 2012, 3:10:02 PM11/2/12
to meteo...@googlegroups.com
"Platform" is pretty specific. Did you make your bundle on 64-bit Linux, and you are now running it on 32-bit (which is what that path looks like?)

Dror Matalon

unread,
Nov 2, 2012, 3:26:14 PM11/2/12
to meteo...@googlegroups.com
I made and ran the bundle on the same AMI, ami-1add532a, which is a 32
bit ubuntu EC2 server.

Linux version 3.2.0-29-virtual (buildd@roseapple) (gcc version 4.6.3
(Ubuntu/Linaro 4.6.3-1ubuntu5) ) #46-Ubuntu SMP Fri Jul 27 17:47:52
UTC 2012

David Glasser

unread,
Nov 2, 2012, 5:12:59 PM11/2/12
to meteo...@googlegroups.com
That's surprising! If you look inside the bundle tarball, what's in "server/node_modules/fibers/bin"?

David Glasser

unread,
Nov 2, 2012, 5:14:08 PM11/2/12
to meteo...@googlegroups.com
Although I note that you mentioned Node 0.6. That's probably the issue. Meteor these days requires Node 0.8. The docs were out of date until this morning (thanks David Workman for a pull request fixing this!) but you want Node 0.8.

Dror Matalon

unread,
Nov 2, 2012, 6:45:38 PM11/2/12
to meteo...@googlegroups.com
find server/node_modules/fibers/bin
server/node_modules/fibers/bin
server/node_modules/fibers/bin/.npmignore
server/node_modules/fibers/bin/linux-ia32-v8-3.11
server/node_modules/fibers/bin/linux-ia32-v8-3.11/fibers.node

Frankly, it's not really a problem for me, just installed Fibers,
though it was a little bit of a pain, but I guess it's good to know
that vanilla Ubuntu Precise on EC2 currently runs an old version of
node.

David Glasser

unread,
Nov 2, 2012, 6:57:07 PM11/2/12
to meteo...@googlegroups.com
Yup, that's the issue: if you look at the path names, you'll see that Node 0.6 is looking for it in the "linux-ia32-v8-3.7" directory (since Node 0.6 uses v8 3.7) and Node 0.8 is using v8 3.11.

Meteor does require Node 0.8 (maybe it should actually fail without it?). Most of the things that actually care about the difference are in the client-side Meteor tool, but there are some changes in the server (notably, there's a call to fs.existsSync in server.js which was called path.existsSync in 0.6).

David Glasser

unread,
Nov 2, 2012, 6:59:24 PM11/2/12
to meteo...@googlegroups.com
BTW, you can always install Meteor on your AMI (curl https://install.meteor.com/ | sh, which on Ubuntu will install a .deb) and then you can use the version of Node that it installs in /usr/lib/meteor/bin/node.

Dror Matalon

unread,
Nov 2, 2012, 9:14:59 PM11/2/12
to meteo...@googlegroups.com
If it requires 0.8 I agree that it should fail on earlier versions.

I did install meteor this way, but didn't realize that it includes
node. I confirm that using the Meteor node works without a separate
Fibers install. Close that ticket :-).

Julien Chaumond

unread,
Nov 3, 2012, 5:25:17 AM11/3/12
to meteo...@googlegroups.com
Here's how to install the latest stable Node from your Ubuntu:


Clearly documented from Node's Github homepage :)

Julien

Dror Matalon

unread,
Nov 3, 2012, 1:02:52 PM11/3/12
to meteo...@googlegroups.com
The problem is that on Precise, the latest version is 0.6.2
http://packages.ubuntu.com/precise/nodejs
while Meteor requires 0.8+.

Seems like the best solution is to use the node that is packaged in
the Meteor package since that's always going to be compatible.

David Glasser

unread,
Nov 5, 2012, 5:06:31 PM11/5/12
to meteo...@googlegroups.com
OK, we now require you to run Meteor with a version of Node at least as new as the one in the dev bundle. (We definitely do assume when doing QA that (eg) we can remove workarounds for bugs fixed in the version of Node in the dev bundle, so I think it's reasonable to require at least the exact version in the dev bundle.)


Thanks for the suggestion!
Reply all
Reply to author
Forward
0 new messages