sandervandepas_33359
02/29/2024, 1:43 PMMike Chambers
02/29/2024, 2:04 PMsandervandepas_33359
03/01/2024, 9:23 AMMike Chambers
03/01/2024, 1:15 PMcsharp
@inject IServerRoleAccessor serverRoleAccessor; @(serverRoleAccessor.CurrentServerRole)
Did you also notice that the examine settings should be different between schedulingpublisher
and subscriber
?
https://docs.umbraco.com/umbraco-cms/v/10.latest-lts/fundamentals/setup/server-setup/load-balancing/azure-web-apps#lucene-examine-configuration
I think you would take the same approach for any flexible setup as azure.Mike Chambers
03/01/2024, 1:26 PMWEBSITE_DISABLE_OVERLAPPED_RECYCLING -> NO
to the configuration appsettings in azure to stop this.sandervandepas_33359
03/01/2024, 2:50 PMsandervandepas_33359
03/01/2024, 2:52 PMsandervandepas_33359
03/01/2024, 3:00 PMMike Chambers
03/02/2024, 10:35 AMIsSchedulingPublisherServer: False
are you actually checking that your subscribers are Role == Subscriber and not just !schedulingPublisher
? (sorry if that's asking you to suck eggs)
We have
csharp
using Umbraco.Cms.Core.Sync;
namespace www.Extensions.LoadBalancing
{
public class SetServerRegistrarRoles : IServerRoleAccessor
{
private readonly IWebHostEnvironment _env;
public SetServerRegistrarRoles(IWebHostEnvironment env)
{
_env = env;
}
public ServerRole CurrentServerRole
{
get
{
return _env.EnvironmentName switch
{
"Development" => ServerRole.Single,
"Production" or "Staging" or "Local.Publisher" => ServerRole.SchedulingPublisher,
_ => ServerRole.Subscriber,
};
}
}
}
}
Note the default of ServerRole.Subscriber
as from memory there was something where the Environment name was returning null or empty in some scenario....Mike Chambers
03/02/2024, 12:24 PMcsharp
// register a server registrar, by default it's the db registrar
Services.AddUnique<IServerRoleAccessor>(f =>
{
GlobalSettings globalSettings = f.GetRequiredService<IOptions<GlobalSettings>>().Value;
var singleServer = globalSettings.DisableElectionForSingleServer;
return singleServer
? new SingleServerRoleAccessor()
: new ElectedServerRoleAccessor(f.GetRequiredService<IServerRegistrationService>());
});
https://github.com/umbraco/Umbraco-CMS/blob/contrib/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs#L248C13-L256C16A hub and casual space for you to interact with fellow community members and learn more about Umbraco!
Powered by