Multi Server Setup - WeTeam/WeBlog Wiki

Comments in a Multi-server Environment

WeBlog 4.2 and later

In a multi-server environment, comments are created on the Content Delivery (CD) server and then must be transferred to the Content Management (CM) server for verification, approval and publishing to the entire cluster.

WeBlog 4.2 and later uses the Sitecore Event Queue to submit comments from the CD server to the CM server. A large benefit of the Event Queue is that it works out-of-the-box with no additional infrastructure or configuration necessary. However, the event queue can grow quite large over time and can do with some regular maintenance. Refer to the Clean up the EventQueue and PublishQueue tables documentation from the Sitecore documentation.

WeBlog registers components on the CM server to handle the "comment created" remote events as they're raised. The components are defined in the App_Config\Include\WeBlog.Comments.Handler.config configuration patch file. Only one CM server needs to handle the comments. In an environment where there is more than one CM server, disable this file on all but one CM server.

WeBlog 4.1 and earlier

:exclamation: This documentation is for WeBlog 4.1 and ealier. Is it not relevant to latest WeBlog releases.

WeBlog contains a WCF server and client to allow running the module in a multi-server environment. This is required as the comments will be collected and submitted on the CD server but the master database where the comment item needs to be created is connected to the CM server. The CM server can be configured to host the WCF server that the client on the CD server will call.

The App_Config\Include\WeBlog.config file contains sample WCF configuration for both the server and the client.

CM Server Configuration

The CM server will host the WCF service which is exposed by the Sitecore.Modules.WeBlog.Services.CommentService class. The following sample configuration shows what should be added to the web.config file to host the service.

<configuration>
	<system.serviceModel>
		<behaviors>
			<serviceBehaviors>
				<behavior name="Sitecore.Modules.WeBlog.Services.CommentServiceBehaviour">
					<serviceMetadata httpGetEnabled="true" />
					<serviceDebug includeExceptionDetailInFaults="true" />
				</behavior>
			</serviceBehaviors>
		</behaviors>
		<services>
			<service name="Sitecore.Modules.WeBlog.Services.CommentService"
				behaviorConfiguration="Sitecore.Modules.WeBlog.Services.CommentServiceBehaviour">
				<endpoint address="" binding="wsHttpBinding" contract="Sitecore.Modules.WeBlog.Services.ICommentService">
					<identity>
						<dns value="localhost" />
					</identity>
				</endpoint>
			</service>
		</services>
	</system.serviceModel>
</configuration>

CD Server Configuration

The CD server also needs to be configured to call the WCF service on the CM server rather than trying to create the comment in the locally connected master database. The following sample configuration shows what should be added to the web.config file to host the service.

<configuration>
	<system.serviceModel>
		<client>
			<endpoint address="http://[authoring server address]/sitecore modules/WeBlog/Comment.svc"
				binding="wsHttpBinding" contract="Sitecore.Modules.WeBlog.Services.ICommentService"
				name="WeBlogCommentService">
				<identity>
					<dns value="localhost" />
				</identity>
			</endpoint>
		</client>
	</system.serviceModel>
</configuration>

Note: Replace [authoring server address] above with the address of the application hosting the WCF server (Sitecore CM server)

You'll also need to configure WeBlog to use the WCF server by changing the WeBlog.CommentService.Enable Sitecore setting to true. You'll find this setting in the App_Config\Include\WeBlog.config file.

<setting name="WeBlog.CommentService.Enable" value="true"/>

HTTP Activation of WCF service

To allow WCF services to be activated by an HTTP request, make sure to enable the HTTP WCF activation components in Windows setup.

The following is a screenshot of the components under Windows 10.

[[WCF-activation-windows10.png]]

Indexes in a Multi-server Environment - Obsolete

:exclamation: This is only required in older versions of Sitecore and is not required in Sitecore 9.0 or later.

Due to the means by which Sitecore clears caches and updates indexes in multi-server configurations, you may encounter a race condition in which blog entries do not appear after publishing. The quick fix is to disable caching on the WeBlog sublayouts, and set Indexing.UpdateInterval to a more frequent schedule (5 minutes by default). See the following post from Alex Shyba for a more comprehensive solution.

Sync up Sitecore Search Index Update and HTML cache clear

For more information on search and indexing, see the <http://sdn.sitecore.net/Reference/Sitecore%206/Sitecore%20Search%20and%20Indexing.aspx Search and Indexing Guide>