Sitecore Server Synchronization

When you have multiple CM and CD servers, the use of event queue is required and also important. For more information, you may read my post on Sitecore Event Queues. In brief, the event queue will allow all your servers to be synchronized. Also, your scalability settings needs to be well setup. However, one or more servers can take time to synchronize.

You can easily check if all your servers are in sync. In this post, I will explain how to check the synchronization of your servers. Supposed you have 5 servers including a job server shown below:

Job

The job server will have the task to trigger the publishing. When publishing is completed, Sitecore will update the event queue table with the different events such as indexing:start, clear html cache and so on.

From there, each server will start to synchronize in order to have all the events that is being triggered. In other words, the Job server will have the highest number of items, the other servers will need to catch up so that the number of items equals to the number of items from the job server.

SQL Query for Sitecore Properties table

In order to know the number of item count, you can use the following SQL query on your Target Database, for example, the Web Database.

select * from [Properties] with (nolock) where [Key] like ‘EQSTamp%’

This SQL query will return a result like the one below

Records

Note that the records will be different for your servers. Based on the screenshot above, the Job Server will always have the highest number of items. In order for the CD servers to be in synced, their values needs to match up with the Job Server.

  • CD2 is in sync
  • CD 1 is not in sync. There is still 80 item to go for it to be in sync.
  • CD 3 and CD4 are also not in sync. 400000 items remains for CD 3 and 2000 for CD 4 to be in sync.

When all servers are in sync, this means that the different events found in the event queue have already been triggered. This is one way to see if indexes or cache clearing have been triggered on the servers.

Using the value from the Properties Table of your Target Database, for example, 43697099, you can convert the the value in order to get the exact record from the Event Queue table. To convert the following to Hexadecimal, please follow the step below:

  1. Copy the value, for example 43697099.
  2. Open your calculator and set it to Programmer.
  3. Paste the copied value.
  4. Select the Hex radio button to get the value.

With the value obtained, if you use the below query, the Stamp Field value of the first record will be equal to the same value obtained from the conversion.

select top 100 * from [EventQueue] with (nolock) order by [Stamp] desc

Conclusion

You can use the below query first to get the highest Stamp value.

select top 100 * from [EventQueue] with (nolock) order by [Stamp] desc

Then convert the Stamp value to decimal and use the below query to obtained the different values.

select * from [Properties] with (nolock) where [Key] like ‘EQSTamp%’

Using Excel, you can easily see which servers are not in sync.

Advertisements

2 thoughts on “Sitecore Server Synchronization

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s