Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I tried setting up a MongoDB 3-node replica set in OpsWorks a few months back. I will share a bit of my experience:</p> <p><strong>1) How to install a single MongoDB:</strong> It is possible and easy to install a single mongodb using the <a href="https://github.com/edelight/chef-mongodb" rel="nofollow noreferrer">EDelight Chef MongoDB Cookbook</a>. Just add it as a submodule in your custom opsworks chef repository. </p> <p>To get it to work create a custom layer and call it MongoDB and excecute the following recipes</p> <ul> <li><strong>SETUP</strong>: mongodb:10gen_repo</li> <li><strong>CONFIGURE</strong>: mongodb:default</li> </ul> <p>This will install the latest version of MongoDB.</p> <p>NOTE: I used Ubuntu instances. </p> <p><strong>2) MongoDB Best Practices</strong> If you talk to MongoDB engineers or customer service reps, they will all tell you that the recommended setup for MongoDB is a 3 node replica set. This means one master and two read replicas hopefully in different availability zones. Also an ideal setup will have lots of RAM, to give you an example: the smallest instance provided by MongoDB that you can find in the AWS market place is a standard large:</p> <p><img src="https://i.stack.imgur.com/AKSXF.png" alt="MongoDB instance on AWS marketplace"></p> <p>You also have to consider using EBS on RAID10, maybe reserved IOPS...</p> <p>See the white paper <a href="http://info.mongodb.com/rs/mongodb/images/AWS_NoSQL_MongoDB.pdf" rel="nofollow noreferrer">MongoDB on AWS</a> for more info.</p> <p><strong>3) Security Considerations</strong> Ideally you want only application instances to access the DB instances. In AWS you could create a security group with custom rules and assign EC2 instances to the group you just created... Is not quite like this when it comes to OpsWorks as it forces you to have default security groups that have very lax restrictions. AWS will always adopt lax permissions over stricter ones. </p> <p><strong>4) Time and Money Considerations</strong> If the recommended setup is a 3 node replica set using large instances you are looking at at least $600 (on demand) for the DB and this doesn't add reserved IOPS, EBS, and so on. Automating this setup is possible yet not simple. It will take time or an expert in the subject to get you going. If you have the resources and personnel to deal with this go for it. If you are part of a small development team that want's to code more and do less operations, read on.</p> <p><strong>5) Find a reliable Managed Solution</strong> At first I was reluctant to the idea of using a third party company that offered MongoDB as a service. After much evaluation of the different options (Managed, AWS Marketplace, OpsWorks, Direct EC2 installation), I concluded that for our small team the best thing to do was to use either MongoLab or MongoHQ. They host and mange MongoDB instances of all sizes and prices. They even let you choose the hosting (AWS, Rackspace, etc), region and AZ. Price wise will be more expensive if you look at the hardware alone, but like I mentioned before you have to consider not only the price but the operational time MongoDB will require. </p> <p>I have been there, done that, and ended up not using OpsWorks to host MongodDB. Hopefully this will save you some time and headaches. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload