All posts by Arnaud Bonnet

How to deliver applications with high availability

elasticbox-high-availability

How many times have you felt less-than-confident about the stability of your most critical applications in case of a disaster? We have all experienced the frustration of losing control of our systems, processes, applications and infrastructure resources while not being able to easily recover from downtime (planned or unplanned).

With the latest release of ElasticBox, those times have come to an end. Read More

Hacker News

Why is the developer’s dream an operations nightmare?

facepalm

As a developer at ElasticBox, I wear the IT Ops hat just as often as I spend time writing code. So I understand all too well the pain IT Ops endure to keep things running smoothly after a production update. In the continuous delivery world where small, incremental code changes are deployed every day, chances are that IT Ops have to constantly put out fires. Luckily, in my own job, I’ve been able to leverage a combo of tools and workflows to catch the problems right where they originate — in the development environment. Read More

Hacker News

Go undercover with the ElasticBox agent

elasticbox-agent

It’s no secret that ElasticBox performs deployments on your remote virtual machines using an agent. But what goes on behind the scenes? What makes the agent tick? Join me for a deep dive. Read More

Hacker News

Deploying a MongoDB Cluster with ElasticBox

With ElasticBox, you can easily deploy a self replicating MongoDB cluster in just a few minutes. In order to accommodate ElasticBox’s data needs, we rely on MongoDB clusters that run on two public clouds and one private data center.

This way we can provide redundancy, high availability and excellent read and write performance around the world. Using ElasticBox, and our concept of Boxes, which are application or infrastructure components made available as a service, we can consistently deploy a MongoDB cluster in just a matter of minutes on any of our Cloud Providers.

To get started deploying MongoDB clusters on ElasticBox, sign up today for our free account! If you’re interested in other resources on MongoDB, check out how you can easily use Splunk to monitor MongoDB using ElasticBox.

The Basics

What is MongoDB? MongoDB is an open-source document store database.

Why would you want to cluster MongoDB? To provide redundancy and high-availability for production deployments.

How We Use MongoDB

In our case, MongoDB is using a replica set model. A replica set is a group of MongoDB instances that host the same data set. One MongoDB, the primary, receives all write operations. All other instances, secondaries, apply operations from the primary so that they have the same data set.

The primary accepts all write operations from clients. Replica sets can have only one primary. Because only one member can accept write operations, replica sets provide strict consistency.

 

Deploying MongoDB through ElasticBox

ElasticBox provides a default MongoDB box that’s available to the public. It deploys a standalone instance of the MongoDB server. Our MongoDB production box very closely resembles the default box, minus a few configuration settings required for our production scenario.

While the default MongoDB box configuration is suited for development purposes, it needs to be configured further to use in production. To configure the MongoDB default box for production use, follow the steps below:

Step 1. Create a new box called MongoDB Replica. Add a box variable for the MongoDB Server (this is to use the default box settings).

 

Step 2. Add a text variable REPLICA_SET to hold the replica set name. This value must be shared between all the members of the cluster.

 

Step 3. Expand the MongoDB Server box. Edit its file variable COMMON_YAML and paste the following:

mongodb::replica_set: {{ REPLICA_SET }}

mongodb::key_file: /etc/mongod.key

 

 

This file will be used by hiera to pass arguments to puppet automatically without modifying the existing puppet default.pp file.

Step 4. Add a binding named primary of type MongoDB Replica (the box you just created).

 

Step 5. Add an install script. Get the script here.


 

 

Step 6. Add a start script. Get the script here.

 

When you deploy the box without a binding, it creates a cluster for you with an initial configuration. On the other hand, if you bind to an existing instance, it adds the instance to the existing cluster!

There, you have it, a MongoDB cluster in a few easy steps!

Hacker News