Is this really the version you are looking for? Kentico Xperience 8.1 Documentation is no longer updated. Use the switcher in the header to choose your product version.
To use web farm synchronization, you need to enter the internal URLs of all your servers into the system. Perform at least the following steps:
To add a server to the web farm:
Open the Web farm application.
Click New server.
Fill in the following fields:
Click Save to register the server.
Repeat the process for every server in your web farm.
You also need to update the web.config file on each server and add the CMSWebFarmServerName key into the appSettings section:
<add key="CMSWebFarmServerName" value="ServerCodeName"/>Replace ServerCodeName with the server code name that the system created for the server (or the code name that you manually entered). Every server must contain only one such key with its own name.
After you define your web farm servers, you need to enable web farm synchronization in the settings:
You can perform additional low-level settings for web farm synchronization by adding the keys listed in Web.config file settings into the /configuration/appSettings section of your web.config file.
Enter an appropriate license key for the internal URLs of all your web farm servers.
For example, if you use the web farm for domain name example.com and access the servers internally through URLs like:
Enter separate license keys for example.com, 192.168.1.2 and 192.168.1.3 in the Licenses application. You only need to add the licenses on one server and restart the other instances using the System application (click Restart application).
When you enable web farm functionality on a Kentico instance, we recommend that you use only those website domains, for which you have licenses with the same number of web farm servers allowed. If you have a website which can be run on multiple servers, adding another website with fewer allowed web farm servers can cause "License web farm server count exceeded." errors.
These are the possible solutions for this problem:
The system uses signatures to ensure the security of macro expressions. Macro signatures contain the user name of the macro's author and a hash of the given expression.
The hash function used to create the signatures appends a salt (opens in a new tab) to the input. To ensure that macro expressions work correctly in a web farm environment, you need to configure all servers to use the same hash salt:
Set the CMSHashStringSalt key in the appSettings section of the web.config file to the same value on all web farm servers. For example:
<add key="CMSHashStringSalt" value="e68b9ad6-a461-4707-8e3e-ece73f03dd02" />The best option is to set the hash salt value before you start creating content for your website. Changing the salt causes all current hash values to become invalid. To fix existing macro expressions in the system after changing the hash salt, you need to re-sign the macros. See Working with macro signatures for more information.
By default, web farm servers are updated with changes made on other servers once per request. Synchronizing this frequently may be impractical for high‑traffic websites. To change the synchronization interval, set the value of the CMSWebFarmUpdateWithinRequest web.config key to false:
<add key="CMSWebFarmUpdateWithinRequest" value="false"/>and use the Synchronize web farm changes scheduled task instead, which has a configurable execution interval:
You also need to create the task for each server in the web farm. To create the tasks quickly:
Note: All web farm servers that you wish to use need to be registered in the system before performing the following steps.
Your web farm now synchronizes according to the interval of the scheduled tasks.
If synchronization doesn't work as expected, you can check the Tasks tab of the Web farm application's interface. The tab provides information about all synchronization tasks that are currently active (waiting to be processed).
Click Run tasks to manually execute tasks, regardless of how the synchronization interval is currently configured.
You can remove all listed tasks by clicking Clear task list, or individual tasks via the Delete () action. Clearing the list is not necessary if the web farm is working correctly — the system automatically removes successfully processed tasks.
A similar user interface can be found on the Anonymous tasks tab. This tab displays a list of currently active (waiting to be processed) anonymous synchronization tasks. These tasks are logged by external applications (e.g. Windows services) to ensure that changes made by the external application are reflected in the web application cache. Tasks are logged as anonymous only if the application is NOT configured to run in a web farm. If it is configured to run in a web farm, these tasks are logged as standard synchronization tasks on the Tasks tab.
See also: Debugging web farms
An alternative way of defining web farm servers is letting the system create the servers automatically on application start.
Prerequisite: You need to have web farm synchronization enabled on all the servers.
Alternatively, you can add the following key to the appSettings section of your web.config file:
<add key="CMSWebFarmGenerateServers" value="true"/>All servers with enabled web farm support add themselves into the list of servers when the application starts. If a server doesn't have a server name defined in the web.config, it uses its machine name.