{"id":2369,"date":"2016-05-04T10:50:09","date_gmt":"2016-05-04T10:50:09","guid":{"rendered":"http:\/\/sitecore.robhabraken.nl\/?p=2369"},"modified":"2019-12-18T12:58:46","modified_gmt":"2019-12-18T12:58:46","slug":"configuring-server-roles-part-1","status":"publish","type":"post","link":"https:\/\/www.robhabraken.nl\/index.php\/2369\/configuring-server-roles-part-1\/","title":{"rendered":"Configuring server roles"},"content":{"rendered":"<p>I have invested a lot of time lately in&nbsp;configuring different server roles and trying to see structure in the Sitecore documentation concerning server role configuration, which can be found here&nbsp;<a href=\"https:\/\/doc.sitecore.net\/sitecore_experience_platform\/xdb_configuration\/configuring_servers\" target=\"_blank\" rel=\"noopener noreferrer\">(&#8230;)\/xdb_configuration\/configuring_servers<\/a>. Mind that the documentation behind this link constantly changes, so I cannot guarantee that my blog will stay consistent with it, but at least for now it is. Actually, that is one of my largest concerns considering this topic: there&#8217;s only a version toggle on the top right between 8.0 and 8.1, but when working on it for a few weeks I saw it changing, without any chance logs or notifications. It is hard to make up if you need to update your Sitecore implementations based on those silent updates&nbsp;and even harder to keep track of any changes this way. I already sent in a feature request for this.<\/p>\n<p>I intend to do a series on this topic and share my findings, ultimately leading to an easy set of documentation on this. But to be honest, when almost having finished my first blog, it got outdated right away because Sitecore released an update.. I didn&#8217;t like the online list of files to disable and to enable, which was already improved&nbsp;by providing the list as an Excel worksheet (which also included numerous fixes like combining path and filename, using backward slashed instead of forward slashes and allowing you to sort on alphabet and on enable\/disable if you want). So I will still share as much as possible, but I know Sitecore is working on this too.<\/p>\n<h2>onPublishEndAsync strategy<\/h2>\n<p>One of the things which turns out to be incomplete or not the full truth, is how to configure the<strong> processing server<\/strong>. The following instructions tell you to comment out the onPublishEndAsync strategy containing a reference to the web database, which isn&#8217;t available from the processing server:&nbsp;<a href=\"https:\/\/doc.sitecore.net\/sitecore_experience_platform\/setting_up__maintaining\/xdb\/configuring_servers\/configure_a_processing_server\" target=\"_blank\" rel=\"noopener noreferrer\">(&#8230;)\/configuring_servers\/configure_a_processing_server<\/a>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2371\" src=\"http:\/\/sitecore.robhabraken.nl\/wp-content\/uploads\/2016\/05\/onpublishendasync.png\" alt=\"onpublishendasync\" width=\"1012\" height=\"347\" srcset=\"https:\/\/www.robhabraken.nl\/wp-content\/uploads\/2016\/05\/onpublishendasync.png 1012w, https:\/\/www.robhabraken.nl\/wp-content\/uploads\/2016\/05\/onpublishendasync-300x103.png 300w, https:\/\/www.robhabraken.nl\/wp-content\/uploads\/2016\/05\/onpublishendasync-768x263.png 768w\" sizes=\"auto, (max-width: 1012px) 100vw, 1012px\" \/><\/p>\n<p>Upon doing so, your processing server might stop working (strange enough, it didn&#8217;t in all cases) while reporting about the following exception:<\/p>\n<pre class=\"lang:default decode:true \">ManagedPoolThread #14 15:02:08 INFO  Trying to load XML configuration \/App_Config\/Security\/Domains.config\n3220 15:02:08 ERROR Error loading hook: &lt;hook type=\"Sitecore.ContentSearch.Hooks.Initializer, Sitecore.ContentSearch\" patch:source=\"Sitecore.ContentSearch.config\" xmlns:patch=\"http:\/\/www.sitecore.net\/xmlconfig\/\" \/&gt;\nException: System.InvalidOperationException\nMessage: Could not find configuration node: contentSearch\/indexConfigurations\/indexUpdateStrategies\/onPublishEndAsync\nSource: Sitecore.Kernel\n   at Sitecore.Diagnostics.Assert.IsTrue(Boolean condition, String message)\n   at Sitecore.Configuration.Factory.GetConfigNode(String xpath, Boolean assert)\n   at Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert)\n   at Sitecore.Configuration.Factory.CreateFromReference(XmlNode configNode, String[] parameters, Boolean assert)\n   at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)\n   at Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert)\n   at Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper)\n   at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)\n   at Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert)\n   at Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper)\n   at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)\n   at Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert)\n   at Sitecore.ContentSearch.ContentSearchManager.get_SearchConfiguration()\n   at Sitecore.ContentSearch.Hooks.Initializer.Initialize()\n   at Sitecore.Events.Hooks.HookManager.LoadAll()<\/pre>\n<p>This isn&#8217;t strange at all, because multiple configuration files, that are still enabled on the processing server as indicated by the documentation, list the onPublishEndAsync strategy. I had contact with Sitecore support on this, and however we could not find the reason why it <em>did<\/em> work on one of our implementations, we concluded that you cannot only remove the strategy, while not removing any references to it.<\/p>\n<p>So, our solution was to remove this strategy from the list in all of the following files as well (inside \\Website\\App_Config\\Include\\):<\/p>\n<div style=\"font-size: 0.9em;\">\n<ul>\n<li>FXM\\Sitecore.FXM.Lucene.DomainsSearch.Index.Web.config<\/li>\n<li>Social\\Sitecore.Social.Lucene.Index.Web.config<\/li>\n<li>Sitecore.ContentSearch.Lucene.Index.Web.config<\/li>\n<li>Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Lucene.Index.Web.config<\/li>\n<li>Sitecore.Marketing.Lucene.Index.Web.config<\/li>\n<\/ul>\n<\/div>\n<p>Here&#8217;s an example of an XSL translation for all of these files (the structure is the same on all these Index.Web.config files), if you want to manage this via SlowCheetah from within your solution:<\/p>\n<pre class=\"lang:xhtml decode:true\">&lt;configuration xmlns:patch=\"http:\/\/www.sitecore.net\/xmlconfig\/\" xmlns:xdt=\"http:\/\/schemas.microsoft.com\/XML-Document-Transform\"&gt;\n  &lt;sitecore&gt;\n    &lt;contentSearch&gt;\n      &lt;configuration&gt;\n        &lt;indexes&gt;\n          &lt;index&gt;\n            &lt;strategies&gt;\n              &lt;strategy ref=\"contentSearch\/indexConfigurations\/indexUpdateStrategies\/onPublishEndAsync\" xdt:Transform=\"Remove\" xdt:Locator=\"Match(ref)\" \/&gt;\n            &lt;\/strategies&gt;\n          &lt;\/index&gt;\n        &lt;\/indexes&gt;\n      &lt;\/configuration&gt;\n    &lt;\/contentSearch&gt;\n  &lt;\/sitecore&gt;\n&lt;\/configuration&gt;<\/pre>\n<p>Mind that whenever Sitecore recommends to &#8216;comment out&#8217; a section within the config files, I rather remove it completely via an XSL translation; and that I also have removed the strategy as indicated by the documentation I showed above.<\/p>\n<h2>Analytics.Tracking settings<\/h2>\n<p>The content delivery role configuration documentation tells you to add the domain name of your website into the following two settings:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2375\" src=\"http:\/\/sitecore.robhabraken.nl\/wp-content\/uploads\/2016\/05\/analyticstracking.png\" alt=\"analyticstracking\" width=\"1011\" height=\"859\" srcset=\"https:\/\/www.robhabraken.nl\/wp-content\/uploads\/2016\/05\/analyticstracking.png 1011w, https:\/\/www.robhabraken.nl\/wp-content\/uploads\/2016\/05\/analyticstracking-300x255.png 300w, https:\/\/www.robhabraken.nl\/wp-content\/uploads\/2016\/05\/analyticstracking-768x653.png 768w\" sizes=\"auto, (max-width: 1011px) 100vw, 1011px\" \/><\/p>\n<p>However, after doing so we got the strange behaviour of our website that it spontaneously redirected to another domain upon the first request only. A domain we also had configured (from .nl to .com). A quick chat with Sitecore support lead us to the following knowledge base article saying you shouldn&#8217;t populate the HostName setting for this file:&nbsp;<a href=\"https:\/\/kb.sitecore.net\/articles\/792020\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/kb.sitecore.net\/articles\/792020<\/a>.<\/p>\n<p>Here, the documentation of kb.sitecore.net and doc.sitecore.net is conflicting.<\/p>\n<p>Ultimately, the following configuration turned out to be working fine, so I would recommend to ignore the HostName configuration as shown above:<\/p>\n<pre class=\"lang:xhtml decode:true\">&lt;configuration xmlns:patch=\"http:\/\/www.sitecore.net\/xmlconfig\/\" xmlns:xdt=\"http:\/\/schemas.microsoft.com\/XML-Document-Transform\"&gt;\n  &lt;sitecore&gt;\n    &lt;settings&gt;\n      &lt;setting name=\"Analytics.ClusterName\" value=\"www.website.nl\" xdt:Transform=\"Replace\" xdt:Locator=\"Match(name)\" \/&gt;\n      &lt;setting name=\"Analytics.HostName\" value=\"\" xdt:Transform=\"Replace\" xdt:Locator=\"Match(name)\" \/&gt;\n    &lt;\/settings&gt;\n  &lt;\/sitecore&gt;\n&lt;\/configuration&gt;<\/pre>\n<h2>A few other notes<\/h2>\n<h3>Combining server roles<\/h3>\n<p>Another puzzle I came across is combining server roles.&nbsp;The documentation does not specifically mention this, nor does it tell you how to do this, but you can combine server roles on one instance by using the following rule: o<em>nly disable files when both server role configurations tell you to, and always enable configuration files when at least one of the server role configurations command you to do so<\/em>. Eventually, I have succesfully combined the reporting and the processing roles on one instance, where splitting those roles would be overkill and I rather place reporting together with the processing role than leaving it on the management server in such a setup.<\/p>\n<h3>Xdb.Remote.Client.config<\/h3>\n<p>Opposed to the documentation and the comments in the config files itself, the serviceUrl only has to be configured in the Xdb.Remote.Client.config file and not in the two other remote client config files.<\/p>\n<h4>What&#8217;s next?<\/h4>\n<p>Next time I will share my thoughts on how to manage these changes for Sitecore 8.1 and maybe I have some other specific findings to share.<\/p>\n<p>Edit: due to a few good upgrades on this topic from Sitecore regarding their documentation, being a well setup Excel overview of what config should be enabled where, and how to combine these roles, even with the option of choosig between Lucene and Solr, I decided not to do any more blogs on this topic. The most important issues are tackled now.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have invested a lot of time lately in&nbsp;configuring different server roles and trying to see structure in the Sitecore documentation concerning server role configuration, which can be found here&nbsp;(&#8230;)\/xdb_configuration\/configuring_servers. Mind that the documentation behind this link constantly changes, so I cannot guarantee that my blog will stay consistent with it, but at least for [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":2511,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[55],"tags":[24,29,20],"class_list":["post-2369","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-configuring-server-roles","tag-deployments","tag-process","tag-sitecore"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/www.robhabraken.nl\/wp-content\/uploads\/2016\/03\/configuring.jpg","_links":{"self":[{"href":"https:\/\/www.robhabraken.nl\/index.php\/wp-json\/wp\/v2\/posts\/2369","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.robhabraken.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.robhabraken.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.robhabraken.nl\/index.php\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.robhabraken.nl\/index.php\/wp-json\/wp\/v2\/comments?post=2369"}],"version-history":[{"count":31,"href":"https:\/\/www.robhabraken.nl\/index.php\/wp-json\/wp\/v2\/posts\/2369\/revisions"}],"predecessor-version":[{"id":3377,"href":"https:\/\/www.robhabraken.nl\/index.php\/wp-json\/wp\/v2\/posts\/2369\/revisions\/3377"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.robhabraken.nl\/index.php\/wp-json\/wp\/v2\/media\/2511"}],"wp:attachment":[{"href":"https:\/\/www.robhabraken.nl\/index.php\/wp-json\/wp\/v2\/media?parent=2369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.robhabraken.nl\/index.php\/wp-json\/wp\/v2\/categories?post=2369"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.robhabraken.nl\/index.php\/wp-json\/wp\/v2\/tags?post=2369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}