You are here

Configuring Hazelcast between Share instances

This section describes the configuration of Hazelcast clustering between instances of Share.

In a load balanced environment, Alfresco Share now uses Hazelcast to provide multicast messaging between the web-tier nodes. As a result, Share caches no longer need to be disabled for any node, simple cache invalidation message are sent to all nodes when appropriate. Each node functions practically as fast as a single Share instance, enhancing the overall performance of Share.

To enable Hazelcast clustering between Share instances, configure the custom-slingshot-application-context.xml file found at < TOMCAT-HOME>/shared/classes/alfresco/web-extension. This file is used to override the Spring application context beans for Share.
Note: An example custom-slingshot-application-context.xml.sample file is provided in the Alfresco distribution, which now includes this configuration.
To enable the Hazelcast cluster messaging, edit this section on each Share Tomcat instance:
<?xml version='1.0' encoding='UTF-8'?>
<beans xmlns=""
        Hazelcast distributed messaging configuration - Share web-tier cluster config (3.4.8 and 4.0.1 onwards)
        - see
        - and specifically
   <!-- Configure cluster to use either Multicast or direct TCP-IP messaging - multicast is default -->
   <!-- Optionally specify network interfaces - server machines likely to have more than one interface -->
   <!-- The messaging topic - the "name" is also used by the persister config below -->
   <hz:topic id="topic" instance-ref="webframework.cluster.slingshot" name="slingshot-topic"/>
   <hz:hazelcast id="webframework.cluster.slingshot">
         <hz:group name="slingshot" password="alfresco"/>
         <hz:network port="5801" port-auto-increment="true">
               <hz:multicast enabled="true"
               <hz:tcp-ip enabled="false">
            <hz:interfaces enabled="false">

   <bean id="webframework.slingshot.persister.remote" class="" parent="webframework.sitedata.persister.abstract">
    <property name="store" ref="" />
    <property name="pathPrefix"><value>alfresco/site-data/${objectTypeIds}</value></property>
    <property name="hazelcastInstance" ref="webframework.cluster.slingshot" />
    <property name="hazelcastTopicName"><value>slingshot-topic</value></property>

   <bean id="webframework.factory.requestcontext.servlet" class="" parent="webframework.factory.base">
    <property name="linkBuilderFactory" ref="webframework.factory.linkbuilder.servlet" />
    <property name="extensibilityModuleHandler" ref="webscripts.extensibility.handler" />
    <property name="dependencyHandler" ref="dependency.handler" />
    <property name="clusterObjectPersister" ref="webframework.slingshot.persister.remote" />



This configuration enables the Hazelcast Spring integration, which in turn, starts the Hazelcast server. The Hazelcast server is easily configurable and can use either multicast (default) or TCP-IP direct, if preferred. For more information, see the Hazelcast Documentation.

If this configuration is enabled, the Share instance becomes a cluster node and Hazelcast is started. If this configuration is disabled (such as, for a default install), then Hazelcast is not started. While using Share, only when any of the following actions occur, the cache invalidation messages will be sent from the affected node to other nodes in the cluster:
  • an existing site/user dashboard layout is modified
  • new site or user dashboard is created
  • runtime application properties are changed
Note: For activating the default set up, apply identical configuration to each Share node.
The following is a sample output that you get when you start Share:
INFO: /]:5801 [slingshot] Hazelcast Community Edition 2.4 (20121017) starting at Address[]:5801
Dec 13, 2014 12:09:36 PM com.hazelcast.system
INFO: /]:5801 [slingshot] Copyright (C) 2008-2012
Dec 13, 2014 12:09:36 PM com.hazelcast.impl.LifecycleServiceImpl
INFO: /]:5801 [slingshot] Address[]:5801 is STARTING
Dec 13, 2014 12:09:37 PM com.hazelcast.impl.TcpIpJoiner
INFO: /]:5801 [slingshot] Connecting to possible member: Address[]:5802
Dec 13, 2014 12:09:37 PM com.hazelcast.impl.TcpIpJoiner
INFO: /]:5801 [slingshot] Connecting to possible member: Address[]:5803
Dec 13, 2014 12:09:37 PM com.hazelcast.nio.SocketConnector
INFO: /]:5801 [slingshot] 

Members [1] {
	Member []:5801 this

Dec 13, 2014 12:09:38 PM
INFO: /]:5801 [slingshot] Hazelcast Management Center started at port 5901.
Dec 13, 2014 12:09:38 com.hazelcast.impl.LifecycleServiceImpl
INFO: /]:5801 [slingshot] Address[]:5801 is STARTED

The message shows that the configuration has successfully initialized Hazelcast between Share instances.