Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

we are trying to get a MongoDB setup in EC2 going. I had a few questions -

  • Should we turn on auth since the MongoDB endpoint will have a public VIP? Any big hit on perf with auth enabled?
  • Best way to deploy a replicaset in EC2? Do I have to deploy all 3 nodes individually and configure them or can I use a tool to automate the deployment? We would like one of the secondaries to be located in a different DC than the primary.
  • Ubuntu or RHEL? And what version?


share|improve this question
up vote 0 down vote accepted

I'll take this one at a time:

Authentication does come with an overhead, yes but is usually small enough to not be noticeable. I would suggest not having a public MongoDB endpoint if you can avoid it, just from a general security perspective. Or at least lock it down significantly if you do. Also, make sure you use at least version 2.0.6 because of this bug which I have seen have a significant.

You can use your favorite tools - chef, puppet etc. to deploy, but unless you plan to do this multiple times or to expand into multiple shards the set up is not massively complicated for a single replica set - for three members, once the instances are started it is basically a handful of commands to configure the set (rs.initiate() on the first, rs.add() for each subsequent member). The real meat of configuring EC2 when it comes to MongoDB is the EBS storage piece, filesystem etc. See here for the various recommendations on that front:

Ubuntu or RHEL/CentOS is essentially a preference call on your part - do you prefer apt or yum, rpm or deb, SysV init or upstart? Either way, there are repos available from 10gen to keep up to date with the latest version of MongoDB:

In terms of the recommended version, I would usually recommend the latest stable version with long term support - currently I think that would make it CentOS 6.2 and Ubuntu 12.04

share|improve this answer
  1. If you are deploying in a single region remember to deploy each replica in a separate availability zone
  2. If you are deploying across regions keep in mind that the community build of MongoDB does not enable SSL.

For simple scenarios I would recommend configuration 1

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.