Jump to content

How to Install MongoDB

  chco's Photo
Posted Sep 15 2010 06:50 AM

Below we have an excerpt from the recent O'Reilly publication MongoDB: The Definitive Guide. The following information gives a step by step guide on how to install MongoDB and get it up and running smoothly.

Installing MongoDB is a simple process on most platforms. Precompiled binaries are available for Linux, Mac OS X, Windows, and Solaris. This means that, on most platforms, you can download the archive from http://www.mongodb.org, inflate it, and run the binary. The MongoDB server requires a directory it can write database files to and a port it can listen for connections on. This section covers the entire install on the two variants of system: Windows and everything else (Linux, Max, Solaris).

When we speak of “installing MongoDB,” generally what we are talking about is setting up mongod, the core database server. mongod is used in a single-server setup as either master or slave, as a member of a replica sets, and as a shard. Most of the time, this will be the MongoDB process you are using.

Choosing a Version

MongoDB uses a fairly simple versioning scheme: even-point releases are stable, and odd-point releases are development versions. For example, anything starting with 1.6 is a stable release, such as 1.6.0, 1.6.1, and 1.6.15. Anything starting with 1.7 is a development release, such as 1.7.0, 1.7.2, or 1.7.10. Let’s take the 1.6/1.7 release as a sample case to demonstrate how the versioning timeline works:

  • Developers release 1.6.0. This is a major release and will have an extensive changelog. Everyone in production is advised to upgrade as soon as possible.

  • After the developers start working on the milestones for 1.8, they release 1.7.0. This is the new development branch that is fairly similar to 1.6.0, but probably with an extra feature or two and maybe some bugs.

  • As the developers continue to add features, they will release 1.7.1, 1.7.2, and so on.

  • Any bug fixes or “nonrisky” features will be backported to the 1.6 branch, and 1.6.1, 1.6.2, and so on, will be released. Developers are conservative about what is backported; few new features are ever added to a stable release. Generally, only bug fixes are ported.

  • After all of the major milestones have been reached for 1.8.0, developers will release something like, say, 1.7.5.

  • After extensive testing of 1.7.5, usually there are a couple minor bugs that need to be fixed. Developers fix these bugs and release 1.7.6.

  • Developers repeat step 6 until no new bugs are apparent, and then 1.7.6 (or whatever the latest release ended up being) is renamed 1.8.0. That is, the last development release in a series becomes the new stable release.

  • Start over from step 1, incrementing all versions by .2.

Thus, the initial releases in a development branch may be highly unstable (x.y.0, x.y.1, x.y.2), but usually, by the time a branch gets to x.y.5, it’s fairly close to production-ready. You can see how close a production release is by browsing the core server roadmap on the MongoDB bug tracker.

If you are running in production, you should use a stable release unless there are features in the development release that you need. Even if you need certain features from a development release, it is worth first getting in touch with the developers through the mailing list and IRC to let them know you are planning on going into production with a development release and get advice about keeping your data safe. (Of course, this is always a good idea.)

If you are just starting development on a project, using a development release may be a better choice. By the time you deploy to production, there will probably be a stable release (MongoDB keeps a regular cycle of stable releases every couple of months), and you’ll get to use the latest features. However, you must balance this against the possibility that you would run into server bugs, which could be confusing or discouraging to most new users.

MongoDB: The Definitive Guide

Learn more about this topic from MongoDB: The Definitive Guide.

Discover how MongoDB can help you manage a huMONGOus amount of data collected through your web application. With this authoritative introduction, you'll learn the many advantages of using document-oriented databases, and discover why MongoDB is a reliable, high-performance system that allows for almost infinite horizontal scalability. Written by engineers from 10gen, the company that develops and supports this open source database, MongoDB: The Definitive Guide provides guidance for database developers, advanced configuration for system administrators, and an overview of the concepts and use cases for other people on your project.

See what you'll learn

0 Subscribe

1 Reply

+ 4
  alex56's Photo
Posted Mar 16 2012 02:06 PM

Thanks fo the tuto, gonna try this! :-) référencement bretagne