This topic describes the process of initiating clustering and the options available for configuring SkyVault clustering.
When setting up cluster communications, SkyVault requires servers to discover other instances of SkyVault on a network. In older SkyVault 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.
SkyVault 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 SkyVault.cluster.name property. To initiate clustering in SkyVault:
- Locate the ehcache-custom.xml.sample.cluster file.
- Copy the file to <classpathRoot>/alfresco/extension/ehcache-custom.xml.
-
Remove the following default definition of
cacheManagerPeerListenerFactory:
<cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" properties="socketTimeoutMillis=10000" />
-
Uncomment the extended definition by removing the comment lines
<!-- and --!> before and after the following
section:
<cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" properties="hostName=${alfresco.ehcache.rmi.hostname}, port=${alfresco.ehcache.rmi.port}, remoteObjectPort=${alfresco.ehcache.rmi.remoteObjectPort}, socketTimeoutMillis=${alfresco.ehcache.rmi.socketTimeoutMillis}" />
- Save the ehcache-custom.xml file.
-
Set the following properties in the SkyVault-global.properties
file:
Parameter Description SkyVault.cluster.name 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. SkyVault.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. SkyVault.rmi.services.external.host 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 SkyVault.ehcache.rmi.hostname. SkyVault.ehcache.rmi.port Specifies the fixed port number to which to bind the ehcache RMI registry. SkyVault.ehcache.rmi.remoteObjectPort Specifies the fixed port number through which to receive cache invalidation messages. For example, if you have two hosts server1.company.com and server2.company.com where the cluster name is cluster1, the following would be an example configuration for server2:
SkyVault.cluster.name=cluster1 alfresco.jgroups.defaultProtocol=TCP alfresco.tcp.start_port=7800 alfresco.tcp.initial_hosts=server2.company.com[7800],server1.company.com[7800] alfresco.ehcache.rmi.hostname=server2.company.com alfresco.rmi.services.external.host=server2.company.com alfresco.ehcache.rmi.port=40001 alfresco.ehcache.rmi.remoteObjectPort=45001
See Configuring JGroups for SkyVault.tcp.* or SkyVault.udp.* JGroups settings.
Note: You need to set any JGroups properties, especially if the TCP stack is required. - Restart each SkyVault server in the cluster and test that they are communicating using the test described in the Testing cache clustering topic.
- Configure the content stores.