README.md

MongoDB on Azure Worker Roles

Welcome! This project allows you to easily deploy a MongoDB-based application to Windows Azure, particularly ones that use replica sets. (The demo project, MvcMovieSample, creates a three-node replica set by default.)

In this project, the mongod servers run as separate worker role instances. For information about running MongoDB on the newer IaaS virtual machines, see the MongoDB Installer for Windows Azure.

Enable IIS on your local machine. This can be done by going to the "Turn Windows features on or off" control panel, under "Programs". Check "Internet Information Services" and also check ASP.NET under World Wide Web Services|Application Development Features.

Clone the project.

Before opening either solution file, run Setup\solutionsetup.cmd.

Open the solution you want, set the "MongoDB.WindowsAzure.[Sample.]Deploy" project as the StartUp Project, and run it!

The setup script does the following:

Creates the cloud configs for the 2 solutions ServiceConfiguration.Cloud.cscfg

Downloads the MongoDB binaries to lib\MongoDBBinaries.

32-bit note: The setup script downloads the 64-bit version of MongoDB by default. If you are developing with 32-bit Windows, you will need to download the latest 32-bit MongoDB binaries and place them in lib\MongoDBBinaries yourself. Do this after running solutionsetup.cmd so it won't overwrite your work.

Solutions

MongoDB.WindowsAzure.sln - Solution containing just the MongoDB worker role

MongoDB.WindowsAzure.Sample.sln - Solution containing the MongoDB worker role and a sample Web role

Running

This section assumes you have already built a client application to access MongoDB running on Azure. See
the sample application or refer to the wiki on how to build your own application against the solution.
More information can be found at the configuration
and deployment wikis

Default configuration

3 replica set members

replica set name is rs

Local cache for data drive is 1GB

512MB log directory

Deploying and running

The following steps describe how to configure, deploy and run MongoDB replica sets on Azure. More information can be found on the wiki

Running locally on compute/storage emulator

This should work out of the box and no special configuration is needed