Developer forum

Forum » CMS - Standard features » Index information shared by multiple frontend servers

Index information shared by multiple frontend servers

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

We have a multi-server setup using DFS to sync file contents. We're excluding the Indexes folder as they cause lock issue. We then built a custom module that fires an HTTP request to each conencted server for each build:

http://IpOfMachine/Admin/Api/repositories/build/eCommerce/eCommerce-index-index/InstanceName/eCommerce/

It's working and I can see the index being built on each of the machines.

However, when I look under repositories in the backend, it appears that the indexes are still connected. On all three servers, I see the built time of the machine that got its index built last. Also, when building index A I see progress on machine B, C and so on.

I think this is somewhat expected as there's only a single backend machine for /Admin looking at state. It's confusing at least, but I also wonder if we could have other issues. How does Dynamicweb determine if an instance is current / the latest? Does it look at the files on disk (unique to each machine) or at the state in Dynamicweb (shared by all frontend servers)?

Some more guidance on how to run a multi-server setup using stuff like DFS and indexes would be great.

Thanks!


Replies

 
Nicolai Pedersen
Reply

Hi Imar

We did not build DW to support DFS but a shared disk mount for clustering - that is why you can see stuff like this.

The indexing is handled by a task runner and that one keeps its status in \Files\System\Diagnostics\ folder - which you should consider to not sync. So the backend machine needs to hold that one instance of the diagnostics files that it needs to report. Since all frontend servers have different indexes and statuses, the backend would not know - as you have figured...

To find the current instance, the system looks at all instances and check their availability status. Dynamicweb keeps a list of availability internally, so every time you start a build of an instance, that instance is set to unavailable. If the internal list says the instance should be available (currently not being build), a check is made to see if the instance can be opened and if the task manager is working with the instance. Asking the task manager for a status gives us this:

If no Status was found, the Instance was never built:    return value is false
If the task is still running, the State is Running:      return value is false
If the task failed, the State is Failed:                 return value is false
If Status exists and State is Completed:                 return value is true

By default the first available instance is returned. It is assumed that first one instance is build, and then the other(s) - so they will all be either building or up-to-date. With 8.9.1 you can now choose another balancer, taking the newest available instance - leaving an old copy of the index.

BR Nicolai

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Thanks Nicolai, I'll try excluding the folder \Files\System\Diagnostics\ and see if that makes a difference.

Imar

 

You must be logged in to post in the forum