OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.38k stars 1.12k forks source link

Multitenancy on Azure with more than one Cores #2458

Open orchardbot opened 12 years ago

orchardbot commented 12 years ago

loadin created: https://orchard.codeplex.com/workitem/18631

Topology:

Azure deployment of any size with more than one cores.

Problem:

When I try to create a new tenant, the site folder is created only on the core that I am running on. I checked the folders with Remote Desktop and only one CPU has the new Site folders.

After that we can create the new site of course, but whenever Azure connects me to a cpu without the new site, Orchard asks me to create my site again. After I do the initialization process with all cores, everything is ok. The only problem is that Orchard "cooks" more than once and my database is full of duplicates.

The package is for Azure and the settings file exists inside the storage account. The problem is with the new site folder that is created under the App_Data folder at the CPU. It does not propagate to other servers.

When I create the new tenant, if I restart the web role before setting my new site, the changes propagate to other servers also. This seems to workaround the problem.

orchardbot commented 12 years ago

@bleroy commented:

Let's add a warning notification that if in a farm all instances need to be restarted for the changes to be acknowledged everywhere.

orchardbot commented 12 years ago

@sebastienros commented:

But we can't even ensure that the redirect will be handled by the same node which created the tenant, so it might now even show. I quite prefer to say it's a known behavior and creating tenants requires a vm restart. It's not a major issue as creating tenants will be very rare. At some point when we have the farm signals in place it will resolve by itself.

orchardbot commented 12 years ago

Carlbm commented:

To add to this, it happens even with a new deployment. I've deployed to a 2 instance farm and set it up, the second instance wants me to set up orchard again.

orchardbot commented 12 years ago

@sebastienros commented:

What exactly is used in this App_data that should be on both servers ?

orchardbot commented 12 years ago

Carlbm commented:

I have no idea :) guessing here, but assume two instances, a and b. I connect to a and set up the initial orchard deployment. Before it is finished something starts a request for a webpage on b and the shell enters the 'please set me up' state. Once a is finished, b is still in the setup state until the app pool recycles. I've also seen the app get locked on exceptions thrown early in the initialisation process (SQL authentication is one). Even after fixing the error by changing settings.txt clients still get the YSOD. You need to recycle the app to get it to refresh. I think that this could be part of this specific error.