We have the following Master/Replica election going on:
public class MasterReplicaElector : IUserComposer
{
public void Compose(Composition composition)
{
if (MofConfigurationManager.Current.IsFrontEndServer == "true")
{
composition.SetServerRegistrar(new FrontEndReadOnlyServerRegistrar());
}
else
{
composition.SetServerRegistrar(new MasterServerRegistrar());
}
}
}
public class MasterServerRegistrar : IServerRegistrar
{
public IEnumerable<IServerAddress> Registrations
{
get { return Enumerable.Empty<IServerAddress>(); }
}
public ServerRole GetCurrentServerRole()
{
return ServerRole.Master;
}
public string GetCurrentServerUmbracoApplicationUrl()
{
// NOTE: If you want to explicitly define the URL that your application is running on,
// this will be used for the server to communicate with itself, you can return the
// custom path here and it needs to be in this format:
// http://www.mysite.com/umbraco
return null;
}
}
public class FrontEndReadOnlyServerRegistrar : IServerRegistrar
{
public IEnumerable<IServerAddress> Registrations
{
get { return Enumerable.Empty<IServerAddress>(); }
}
public ServerRole GetCurrentServerRole()
{
return ServerRole.Replica;
}
public string GetCurrentServerUmbracoApplicationUrl()
{
return null;
}
}
The load balanced instances are set to front-end server=true
In UmbracoConfig we have the following for the CMS instance:
Am I missing something? Why would the content not be replicated correctly? I can see the content changing every time I refresh the page after a content change...
No Question too silly - but yes, they are. We're using github actions to deploy to the instances. The weird thing is that some of the front-end instances get the updated content, and some don't, so it's not like cache isn't being propagated. I have a feeling it's to do with the UmbracoUrl not being set on the front-end instances, but in a kubernetes cluster, I don't know what the UmbracoUrl would be on which an instance can reach itself...
Load Balanced Setup Content not being replicatd
Hi,
We've set up Umbraco on a Kubernetes instance, with our CMS instance running in a single pod, and our back-end service running on load balanced pods.
We've an issue where content is not synced across the various pods. I feel like we've done all the required steps to ensure Load balancing works.
We have all Media on Azure Blob storage, and that works.
We want to have all examine indexes being built locally on each pod.
We want all content to be synchronised and the cache to be stored locally on the temp folder.
On both Admin and Web pods we have the following being added:
We have the following Master/Replica election going on:
The load balanced instances are set to front-end server=true
In UmbracoConfig we have the following for the CMS instance:
the front-end instances do not have their UmbracoApplicationUrl Set.
Am I missing something? Why would the content not be replicated correctly? I can see the content changing every time I refresh the page after a content change...
Thank you! Gabor
Let me ask the silly question first and ensure that all umbraco instances are using the same database - correct?
No Question too silly - but yes, they are. We're using github actions to deploy to the instances. The weird thing is that some of the front-end instances get the updated content, and some don't, so it's not like cache isn't being propagated. I have a feeling it's to do with the UmbracoUrl not being set on the front-end instances, but in a kubernetes cluster, I don't know what the UmbracoUrl would be on which an instance can reach itself...
is working on a reply...