Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install node.js, couchdb, and others on Amazon EC2?

I am diving into the deep end of server administration for the first time : ) Fun times, I know. I'm a node.js developer, and I've used Nodejitsu thus far. Seeing as prices are rising, I'm taking a stab at setting up my own server with AWS.

On my development machine, I typically utilizes Node.js, CouchDB, Redis, Express.js, NPM, git, vim, n (for node.js version management) and a few other fun tools. I'm on ubuntu, so I usually use apt-get to install things. How do I use yum to install these things? And, if I need to update them later, does that mean my apps will need to be stopped in order for me to make the updates?

Any help would rock!

like image 260
Costa Michailidis Avatar asked Mar 24 '23 23:03

Costa Michailidis


1 Answers

If you want to create a node.js environment on EC2, at time of writing you have three options.

The first is to use an Amazon Linux server (it sounds like you have tried this). Under some circumstances this may prove advantageous for reasons outside your node.js requirements such as price and how current the image is for Amazon.

However as you may have noticed there isn't a pre-built node.js package available via the yum package installer for Amazon linux. This means that you have to download the source, compile and install it yourself - the node js source is available here : git clone git://github.com/joyent/node.git. Then, in typical unix fashion you would do something like : ./configure -> make -> make install. You also have to do the same with npm. I've done this several times and without issue.

Your second option, which might not be the easiest for newbie cloud system administrators is to use AWS Elastic Beanstalk. Elastic Beanstalk has only recently started supporting node but provides an automatically scaling node.js production environment out of the tin. It also provides a configuration management approach to multiple environment deployments. Eventually if you expect to have a large number of users and need to implement a scaled node architecture, this is the approach you'll most likely use to put your node application into production. Disclaimer : I have tried this and found this to be quite difficult.

As others have already suggested the last option is to pick a distribution of linux that does already have a pre-built node package for installation.

With regards to Couchdb and Redis, if you are going to start writing node.js application you may want to consider migrating to the equivalent AWS products. You may want to look at AWS simpledb for which you'll find a robust and useful module here https://github.com/rjrodger/simpledb and instead of using Redis you could use elasticache http://aws.amazon.com/elasticache .

Happy node hacking.

like image 145
Darren White Avatar answered Apr 01 '23 21:04

Darren White