The MongoDB Wrapper for Azure allows you to deploy and run a MongoDB replica set on Windows Azure. Replica set members are run as Azure worker role instances. MongoDB data files are stored in an Azure Blob mounted as a cloud drive. One can use any MongoDB driver to connect to the MongoDB server instance. The MongoDB C# driver v1.3.1 is included as part of the package. Getting the packageThe MongoDB Azure Wrapper is delivered as a Visual Studio 2010 solution with associated source files. The simplest way to get the package is by downloading it from GitHub. It is recommended using the latest tagged version. Alternatively, you can clone the repository run the following commands from a git bash shell: $ cd <parentdirectory> $ git config --global core.autocrlf true $ git clone git@github.com:mongodb/mongo-azure.git $ cd mongo-azure $ git config core.autocrlf true You must set the global setting for core.autocrlf to true before cloning the repository. After you clone the repository, we recommend you set the local setting for core.autocrlf to true (as shown above) so that future changes to the global setting for core.autocrlf do not affect this repository. If you then want to change your global setting for core.autocrlf to false run: $ git config --global core.autocrlf false
ComponentsOnce you have unzipped the package or cloned the repository, you will see the following directories:
Initial SetupRun the appropriate *setup.cmd to setup up the solution for building. The script only needs to be run once. The script does the following:
BuildingThe prerequisites can be found in the Github readme Once these are installed, you can open MongoAzure.sln from Visual Studio and build the solution. Deploying and RunningRunning locally on compute/storage emulatorThe following instructions are for running the sample application To start, you can test out your setup locally on you development machine. The default configuration has 3 replica set members running on ports 27017, 27018 and 27019 with a replica set name of 'rs' In Visual Studio run the solution using F5 or Debug->Start Debugging. This will start up the replica set and the MvcMovie sample application. You can verify this by using the MvcMovie application on the browser or by running mongo.exe against the running instances. Deploying to AzureOnce you have the application running locally, you can deploy the sample app solution to Windows Azure. Note You cannot execute locally against storage in Azure due to the use of Windows Azure Drive. Additional InformationThe azure package wraps and runs mongod.exe with the following mongod command line options: --dbpath --port --logpath --journal --nohttpinterface --logappend --replSet MongoDB 2.1.0-pre is currently used in this package. MongoDB creates the following containers and blobs on Azure storage:
FAQ/Troubleshooting
Known issues/Where do I file bugs? |

PLEASE POST QUESTIONS IN THE USER GROUPS FORUM. Post non-question comments and helpful hints here.
blog comments powered by Disqus