Pages

Sunday, 20 May 2012

Hosting RavenDB on Azure under a worker role

We decided to use RavenDB as the store for the new codewrap internet application, as we decided to use Azure as our PaaS we had to find a solution to run RavenDB on Azure. I found a really good post by Mike Hanley on RavenDB Running in Windows Azure. We now have a really good starting point and a base platform to build on.

The next steps are to secure access to RavenDB more and I will be making some changes to run the endpoints as Internal instead of Input. This should be sufficient for now, as we are still actively in the development phase and data will be dropped and recreated on a regular basis.

I ran into two problems when I followed Mike’s blog, and they were mainly due to my lack of knowledge on Azure.

You need to configure your “StorageAccount” as a connection with YOUR storage account details, to allow the mounting of the cloud drive when deployed to Azure

image

I also had to set the executionContext to elevated as mentioned in the comments to allow RavenDB to listen for HTTP request. You can do this by editing the SeviceDefinition.csdef file.

<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="........." xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
<WorkerRole name="raven.worker" vmsize="Small">
<Runtime executionContext ="elevated" />
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
<Endpoints>
<InternalEndpoint name="Raven" protocol="http" port="8080" />
</Endpoints>
<LocalResources>
<LocalStorage name="RavenCache" cleanOnRoleRecycle="false" sizeInMB="1024" />
</LocalResources>
<ConfigurationSettings>
<Setting name="StorageAccount" />
</ConfigurationSettings>
</WorkerRole>
</ServiceDefinition>

We are now in a good position to evaluate RavenDB on Windows Azure and start some RnD using it as our primary data store.

No comments:

Post a Comment