You are here

Initiating clustering

This topic describes the process of initiating clustering and the options available for configuring Alfresco clustering.

When setting up cluster communications, Alfresco requires servers to discover other instances of Alfresco on a network. In older Alfresco releases, this discovery process used a UDP multicast message (provided by EHCache). Servers in the cluster picked up the message and used the information to set up inter-server communication for inter-cache communication. For details, refer to Using EHCache multicast discovery.

To provide a more flexible cluster discovery process, JGroups is integrated into the repository. JGroups is a toolkit for multicast communication between servers. It allows inter-server communication using a highly configurable transport stack, which includes UDP and TCP protocols. Additionally, JGroups manages the underlying communication channels, and cluster entry and exit.

Alfresco uses JGroups to send the initial broadcast messages announcing a server's availability. After initial setup, it is possible for a server to enter a cluster by setting the property. To initiate clustering in Alfresco:

  1. Locate the ehcache-custom.xml.sample.cluster file.
  2. Copy the file to <classpathRoot>/alfresco/extension/ehcache-custom.xml.
  3. Remove the following default definition of cacheManagerPeerListenerFactory:

  4. Uncomment the extended definition by removing the comment lines <!-- and --!> before and after the following section:

              socketTimeoutMillis=${alfresco.ehcache.rmi.socketTimeoutMillis}" />
  5. Save the ehcache-custom.xml file.
  6. Set the following properties in the file:

    Parameter Description Specifies the name of the cluster. This property is mandatory. Without it, neither JGroups nor index tracking will be enabled.
    index.recovery.mode Set this to AUTO to ensure indexes are refreshed properly on startup.
    alfresco.ehcache.rmi.hostname The externally resolvable DNS name or IP address that other cluster members should use to send this one cache invalidation messages. This would normally be the server’s host name. If you use a public IP v4 address, see the section on Using IP v4 addresses. The externally resolvable DNS name or IP address that external JMX and RMI clients, such as JConsole should use to contact this one. Set this to the same value as alfresco.ehcache.rmi.hostname.
    alfresco.ehcache.rmi.port Specifies the fixed port number to which to bind the ehcache RMI registry.
    alfresco.ehcache.rmi.remoteObjectPort Specifies the fixed port number through which to receive cache invalidation messages.

    For example, if you have two hosts and where the cluster name is cluster1, the following would be an example configuration for server2:

    See Configuring JGroups for alfresco.tcp.* or alfresco.udp.* JGroups settings.

    Note: You need to set any JGroups properties, especially if the TCP stack is required.
  7. Restart each Alfresco server in the cluster and test that they are communicating using the test described in the Testing cache clustering topic.
  8. Configure the content stores.