Keeping modules enabled/disabled across web farm

Topics: Administration, Customizing Orchard, General, Installing Orchard, Troubleshooting
Oct 18, 2012 at 9:57 PM

I deployed a site to two azure instances, and I disabled the Combinator module through the UI. I thought there might be some magic happening that would have this take effect for all machines in the farm, but I found that the two instances each seem to have their own idea of which modules are enabled or disabled. 

Generally I will not be enabling or disabling through the dashboard, but can someone please explain how this works? Where does Orchard store which modules are enabled or disabled? Is it different in Azure vs non-Azure? Is there a way I can force all the farm machines to refresh their module data? 

Azure is a little annoying with issues like this because I don't think there is a way of isolating instances, I don't see for example a way to get an IP or url for a specific web role instance, so I could log into it direct to bring it back into the correct state to match the others. You also can't disable specific instances, so I had to wait until their load balancer decided to send me to the instance with combinator still on, and then quickly go to dashboard and disable it. It worked, but I'm sure there is a better way. 

Coordinator
Oct 18, 2012 at 10:30 PM

It's stored in the database, but the list of enabled modules is initialized when the instance starts. So if you disable on one instance, you need to restart them all. You should be able to do that from the Azure dashboard, I think.

Oct 18, 2012 at 11:01 PM

Thanks, I'll try that next time.

Oct 22, 2012 at 10:14 PM

I am using Web matrix and I have a local copy of my site and a remote copy running as an Azure Web-site.  Both websites point to the same SQL Azure database (this wasn't on purpose,  it just worked out that way).  Everything has been great for the last couple of days. However, today I noticed that several of my modules are no longer in the dashboard panel of the azure website (they used to be) but they are in the dashboard (and working) of the local web site.   Both sites show the modules as beginng enabled.  

As an example,  one of the modules missing from the dashboard of the azure website is favicon and the favicon feature is not working on the azure site. Favicon is in the dashboard of the local site and it is working on the local site. Both sites show favicon as being enabled.

Any thoughts as to what I can do to get the modules to "reappear" in the dashboard on azure?   I tried disabling and renabling them on the azure web site, but that didn't make a difference.

Here are snapshots of the 2 dashboards:

Azure web site:  https://skydrive.live.com/?cid=12cfa9042a2a0519&id=12CFA9042A2A0519%21229

Local web site:  https://skydrive.live.com/?cid=12cfa9042a2a0519&id=12CFA9042A2A0519%21228

Coordinator
Oct 22, 2012 at 10:20 PM

You mean they are in the same database, with the same database prefix (or lack thereof)? If so, just stop right there and start over. Otherwise, your sites are going to slowly disintegrate.

Oct 23, 2012 at 12:14 AM
Edited Oct 23, 2012 at 1:18 AM

Thanks for the quick answer.  Will do. 

And I did.  And now I remember how I got in this pickle in the first place and it may be instructive for someone else (I took screen shots of each of these in case we might want to use them in documentation).

1. On the Azure WebSite dashboard select the "WebMatrix" button.

2. Web Matrix fires up and and copies the azure web-site files to your local system.

3. You get the "Orchard CMS - we need to install dependencies before downloading the files and database your site might need to run locally".  Select "continue".

4. Accept the Orchard Eula.

5.  The "Configure Site" message is displayed.

6.  And then you get the   "Install Failed.  Here's what we couldn't install:  The database 'vpcms591' could not be created."  My azure sql database is named "vpcms" so I assumed it decided that my local copy should be named "vpcms591".

7. Click "OK".  You now have a local copy of your web-site which will run just fine.  The settings file has the Data Connection string pointing to the remote SQL azure database.  Now both the local and Remote websites are using the same database.

 I mistakenly thought it would be OK to run like this (wishful thinking). 

The question is, what do I do to fix it?  Can I just:

1. create an empty database on my local SQL Server

2. Change the connection string in the App_Data/Sites/Default/Settings.txt file (in my local copy) to point to the new local database. (This is what I was afraid to do because I got the message "You are about to modify or remove a core application file or folder.  Making this change could cause the application to stop working" and since everything was working I thought it best to leave well enough alone)

3. Then start the site in Web Matrix where I assume it will give me the Orchard start up screen (and I will specify that my new empty local database is to be used)

4. Import my data from the SQL azure database into the local database using the import/export module.