KML_FLASHEMBED_PROCESS_SCRIPT_CALLS
 

How to Easily Deploy MongoDB in the Cloud

February 3rd, 2014 by - 4,282 views

GoGrid has just released its 1-Button Deploy™ of MongoDB, available to all customers in the US-West-1 data center. This technology makes it easy to deploy either a development or production MongoDB replica set on GoGrid’s high-performance infrastructure. GoGrid’s 1-Button Deploy™ technology combines the capabilities of one of the leading NoSQL databases with our expertise in building high-performance Cloud Servers.

MongoDB is a scalable, high-performance, open source, structured storage system. MongoDB provides JSON-style document-oriented storage with full index support, sharding, sophisticated replication, and compatibility with the MapReduce paradigm. MongoDB focuses on flexibility, power, speed, and ease of use. GoGrid’s 1-Button Deploy™ of MongoDB takes advantage of our SSD Cloud Servers while making it easy to deploy a fully configured replica set.

Why GoGrid Cloud Servers?

SSD Cloud Servers have several high-performance characteristics. They all come with attached SSD storage and large available RAM for the high I/O uses common to MongoDB. MongoDB will attempt to place its working set in memory, so the ability to deploy servers with large available RAM is important. Plus, whenever MongoDB has to write to disk, SSDs provide for a more graceful transition from memory to disk. SSD Cloud Servers use a redundant 10-Gbps public and private network to ensure you have the maximum bandwidth to transfer your data. You can use can GoGrid’s 1-Button Deploy™ to provision either a 3-server development replica set or a 5-server production replica set with Firewall Service enabled.

Development Environments

The smallest recommended size for a development replica set is 3 servers. Although it’s possible to run MongoDB on a single server, you won’t be able to test failover or how a replica set behaves in production. You’ll most likely have a small working set so you won’t need as much RAM, but will still benefit from SSD storage and a fast network.

mongoDB-dev

Production Environments

A production replica set should start with 5 servers. This configuration ensures a fault-tolerance of 2 servers. This replica set will most likely also be on servers with a significant amount of RAM, SSD storage, and a fast 10-Gbps network. In addition, production replica sets should be behind a firewall to prevent unwanted intrusions and lock out the servers from public access (aside from SSH). Ideally, you’ll have an application server in front of the replica set that is the only server communicating with MongoDB. There are other possible configurations available but this is what is provisioned with 1-Button Deploy™.

In addition to the Firewall Service, there are several performance configurations built into the production deployments. These are configurations recommended by MongoDB and typically involve tuning file system behavior.

mongoDB-prod

Why MongoDB?

MongoDB has become a popular NoSQL database because it’s specifically designed to work well with object-oriented languages, JavaScript in particular. That approach makes it easy for developers to integrate this database into their code. Unlike a relational database, MongoDB doesn’t require you to configure the schema up front. All you have to do is start creating data through the API, through the mongo shell, or by importing data with the “mongoimport” command. MongoDB is described as a document database, not because it’s designed to store Word files but because it stores records in BSON (Binary JavaScript Objection Notation). So when you load data, it is stored in BSON format primary as a key and value pair, with Mongo usually generating the unique key of the document for you.

MongoDB also scales horizontally if you configure it as a sharded cluster. This capability is familiar to anyone who has worked with relational databases in the past. If you know that your working set is going to exceed the size of the memory on each of your nodes, then you should consider building out a sharded cluster up front.

1-Button-Deploy™ of MongoDB

Assuming that you have a GoGrid account, login to the management console. Once you’re in the Grid View, click on “Add” to get the “Add New Infrastructure” window. Once you’re there, click on “Big Data Clusters” and select MongoDB.

Add-new-cluster-mongodb

You’re then presented with a screen where you can select either a Production or  Development replica set. Once you click “Deploy,” all the servers, related infrastructure, and configurations will be deployed.

MongoDB-config

You’ll then see the servers for each node as well as an icon representing the cluster itself.

Getting Started

When all the server status lights turn green, it indicates the replica set has been deployed successfully. If there’s a problem building the replica set, then the process will roll back, deleting all the infrastructure. You’ll need to attempt to deploy the replica set again in that scenario.

Assuming that everything is up and running, login to one of the nodes. Use the console service or your favorite client to SSH into the server. If you’re unable to connect with your client, you may need to check your firewall rules, especially if you’ve deployed the Production replica set. Once you’re logged into the server, type “mongo” at the prompt to have a command line interface with the database. If you don’t get any errors, then MongoDB should be running successfully on that server. If the prompt says Primary, then you are logged into the correct server. If it says Secondary, then you need to find the primary. The easiest way to do that is to enter “db.is Master()”. This command will return a document with details regarding the primary and also all the hosts. There is a key called primary, and it will display the IP address of the server. If you’re not already in the primary, then make sure to login to that server. You won’t be able to write on the secondaries, so you need to work directly on the primary. If you want more details on MongoDB, look through our wiki and for more advanced help, review the MongoDB online manual.

GoGrid is committed to releasing additional Big Data solutions using 1-Button Deploy™ technology. In our experience, customers typically deploy multiple Big Data solutions to test what works best for them and which solutions are better suited for specific parts of their business process. Give GoGrid’s 1-Button Deploy™ for MongoDB a shot today and see if this is the right solution for you!

The following two tabs change content below.

Rupert Tagnipes

Director, Product Management at GoGrid
Rupert Tagnipes is Director of Product Management at GoGrid who is responsible for managing and expanding the company’s multiple product lines. His focus is on leveraging his technical background and industry knowledge to drive product innovation and increase adoption of the cloud. He has extensive software product experience at technology companies in Silicon Valley solving data analytics and cloud infrastructure problems for customers across multiple industries.

Latest posts by Rupert Tagnipes (see all)

Leave a reply