How to set Server Role correctly in v10 load blanc...
# help-with-umbraco
s
We keep struggling with the right setup for our load balanced environment. Following the documentation on https://docs.umbraco.com/umbraco-cms/fundamentals/setup/server-setup/load-balancing/flexible-advanced#explicit-schedulingpublisher-server we need to set the server role based on the code in a Composer. We have the following setup for our CM (Backoffice) server: LocalTempStorageLocation: EnvironmentTemp LuceneDirectoryFactory: SyncedTempFileSystemDirectoryFactory IsSchedulingPublisherServer: True MainDomLock: FileSystemMainDomLock UmbracoApplicationUrl: https://acc-cm.ourwebsite.nl/ And the following setup for our CD (Frontend) server: LocalTempStorageLocation: EnvironmentTemp LuceneDirectoryFactory: TempFileSystemDirectoryFactory IsSchedulingPublisherServer: False MainDomLock: FileSystemMainDomLock UmbracoApplicationUrl: https://acc.ourwebsite.nl/ Based on the IsSchedulingPublisherServer appsetting we set the right ServerRegistrar (SchedulingPublisherServerRoleAccessor or SubscriberServerRoleAccessor). So far so good. But after a new deploy it seems that the index wouldn't be recreated on the CM environment and lost most of his items. Do we need to do something with the property "ServerRole" in the appsettings (below Umbraco > CMS > Global) or is that outdated? I heard that in v10 the ServerRole accessor won't work as expected and that it's solved in v11 or v12, but how can we fix this for v10? Hopelfully someone does have the right answer for us. Thanks in advance! Grtz Sander
k
If this is on Azure, you need to follow the Azure Load Balancing Guide: https://docs.umbraco.com/umbraco-cms/fundamentals/setup/server-setup/load-balancing/azure-web-apps There is no
ServerRole
property, where did you find that? Umbraco 8/9? Have you verified that the correct ServerRegistrar is set at startup? The logs should say. Maybe the index non-rebuild isn't related to load balancing at all? Is there something in the CM logs that would say?
Isn't SyncedTempFileSystemDirectoryFactory only supposed to be used with replicated file systems? It sounds like you have 1 CM Instance only and 2 completely standalone installations?
We use Azure for all our Umbracos and never have any index problems when deploying.
s
Hi @kdx-perbol Thanks for your response! A colleague of my told me about the serverRole property in the appsettings, but if this is not needed I deleted it. We followed the documentation (mine and yours) but keep getting wrong/empty examine indexes after a new deploy. How can we verify the correct ServerRegistrar by the log? Can you give me an example of how the log comment looks like, so I can search on that? We've indeed 1 CM Instance (server) only and 1 scalable Frontend Instance (server). Hopefully you can point us in the right direction. Thanks in advance. Grtz Sander
k
Is this on Azure? If so, are the CM and the FI in the same plan?
s
m
s
Hi @mattou07 This should only be set when you use *SqlMainDomLock *, right? But we're using FileSystemMainDomLock, see above, so we don't have set the MainDomKeyDiscriminator option. Or do we need to use** SqlMainDomLock **? If we need to set these, could you give us an example please?
m
I would use SqlMainDomLock if you are using Azure Web Apps and swapping slots. You are moving across different machines in the background on Azure App Service so your LocalTempPath will change. The database will be the same on the load balanced environment so you should use SqlMainDomLock https://docs.umbraco.com/umbraco-cms/reference/configuration/globalsettings#main-dom-lock
On the production slot for your web app set something like: UMBRACO\__CMS\__GLOBAL\__MAINDOMKEYDISCRIMINATOR = MySiteProduction On the slot UMBRACO\__CMS\__GLOBAL\__MAINDOMKEYDISCRIMINATOR = MySiteStagingSlot Set them to be tied to their slot so they are not swapped. As long as the names are unique on the slot it should be ok. I believe on the front end apps they need to match with your back office instance.
s
So your advice is to use on both (Backoffice and Frontdoor) servers SqlMainDomLock? And then in Azure set for the staging slot apps a MainDomKeyDiscriminator key?
m
Typically you do set FileSystemMainDomLock for Azure Web Apps. The main thing that caught my eye is the loss of indexes when you deploy again, I am guessing you have a very large index that takes a while to build? In my case we had about 50,000 items in our indexes and using sqldomlock and the discriminator key helped retain the indexes. Otherwise it would go to zero when we swapped or deployed to it. Just to be specific here is what I am suggesting: Backoffice Azure Web App - App settings UMBRACO\__CMS\__GLOBAL\__MAINDOMKEYDISCRIMINATOR = MySiteProduction UMBRACO\__CMS\__GLOBAL\__MainDomLock = SqlMainDomLock Backoffice Azure Web App Staging SLOT - App settings UMBRACO\__CMS\__GLOBAL\__MAINDOMKEYDISCRIMINATOR = MySiteStagingSlot UMBRACO\__CMS\__GLOBAL\__MainDomLock = SqlMainDomLock Frontend Azure Web App - App settings UMBRACO\__CMS\__GLOBAL\__MAINDOMKEYDISCRIMINATOR = MySiteProduction UMBRACO\__CMS\__GLOBAL\__MainDomLock = SqlMainDomLock Frontend Azure Web App Staging SLOT - App settings UMBRACO\__CMS\__GLOBAL\__MAINDOMKEYDISCRIMINATOR = MySiteStagingSlot UMBRACO\__CMS\__GLOBAL\__MainDomLock = SqlMainDomLock
2 Views