Azure Deployment

In a development environment

The solution can be built and run in a development environment using the Azure emulators as is using Visual Studio 2010 (if adequate disk space is available). Since this solution uses Cloud Drive you cannot run from a development environment against Azure cloud storage. Instead, when you run in your development environment it uses development storage:

  • The mongod log file is at C:\Users\<user>\AppData\Local\dftmp\Resources\<deploymentid>\directory\MongodLogDir Note - On a development environment the port mongod listens on would be configured port (27017 by default) + instance id.
  • The mongod data files are at C:\Users\<user>\AppData\Local\dftmp\wadd\devstoreaccount1\mongoddatadrive(replica set name)\mongoddblob(instance id).vhd\data.
    Note - Additionally when the app is running you should be able to access the drives on mounting as you would access any mounted drive.

In the Azure environment

Login to the Azure management portal using your azure credentials

Azure setup (first time only per deployment)

Affinity Group

Create an affinity group for your deployment. Choose your required location for the group.

Storage account

Create the required number of storage account(s) to store the blobs. For region/affinity choose the affinity group you created earlier. Note The access key for the storage account created is the one you need to specify in your cloud configuration.

Service

Create a new hosted service to host your Mongo package. For region/affinity group use the same affinity group as your storage account. Note for cloud drives the compute and storage instances should be in the same azure domain. Choose do not deploy

Deployment configuration for Mvc Role

If deploying the sample app you can use the default settings as is. You would only need to set the storage settings for diagnostics

Settings

In the Settings tab

  • ReplicaSetName - This should be the same as the replica set name specified in the ReplicaSetRole
  • Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString - Specify your azure storage credentials. Ensure that the connection mode is https.

Deployment configuration for Replica Set Role

Configuration

  • Ensure VM size for ReplicaSetRole is at least Medium. Larger instance sizes provide more RAM and also greater bandwidth. More information on instance sizes can be found here
  • Set the Instance Count equivalent to the required number of replica set members. Default is 3.

Settings

Change connection setting from UseDevelopment storage to actual storage account credentials. It is recommended to use different storage accounts for data and diagnostics. This would allow you to give access to external monitors for diagnostics information without giving access to your data.

  • MongoDBDataDir - Ensure that connection mode is http
  • ReplicaSetName - This is the name of the replica set in the replica set configuration. This is also the suffix to the blob container created in your storage account. Note - This needs to be the same as the replica set name in the client application.
  • MongoDBDataDirSize - Maximum size of your cloud drive where mongod data files are stored. Currently the maximum size can be 1TB.
  • MongoDBLogVerbosity - Verbosity for mongod logging. Default is -v
  • Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString - Ensure that the connection mode is https

Note - If deploying multiple Azure instances make sure you use different storage accounts for each of the deployments or different replica set names if using the same storage account.

Local Storage

Configure the amount of local storage required depending on the VM size chosen. Ensure Clean on recycle role is unchecked. The following are recommendations of Local Storage Note All sizes are in MB.

VM Size MongoDBLocalDataDir MongodLogDir
Medium 256000 (250 GB) 51200 (50GB)
Large 768000 (750 GB) 51200 (50GB)
Extra Large 1024000 (1000GB) 51200 (50GB)

Package and Publish

Create the Azure package by right clicking on the cloud project and choosing Package. Choose the Service Configuration as Cloud and Build Configuration as Release.

When deploying to the Azure cloud make sure to check deployment warnings/errors to see for any breaking issues. Some common errors are

  • Remote desktop is enabled but the remote desktop certificate has not been uploaded to the portal
  • https is not chosen for diagnostics connection string
  • If deploying the sample MvcMovie application, you can safely ignore the warning that indicates you are only running 1 instance of it.

Follow @mongodb

MongoDB Pittsburgh - May 15
MongoNYC - May 23
MongoDB Paris - Jun 14
MongoDB UK - Jun 20
MongoDC - June 26


Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

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

blog comments powered by Disqus