Since clustering is not supported for alfresco community, we have tried to implement our own clustering solution. We have 2 alfresco servers, both have community 5.0.a installed and a load balancer distributes the traffic between these two servers. Both the servers speak to the same database and share a single contentshare/contentshare.deleted repository and this system has been in use for over a year. Now I am trying to replicate the cache on the cluster and I have read that alfresco uses ehcache. So I have created /opt/alfresco-5.0.d/tomcat/shared/classes/alfresco/extension/ehcache-custom.xml and followed steps from this page - http://docs.alfresco.com/4.0/tasks/jgroups-repo.html
My alfresco-global.properties on 'server1' has the below lines -
# Ehcache Settings
alfresco.cluster.name=cluster1
index.recovery.mode = AUTO
alfresco.ehcache.rmi.hostname=server2@domain
alfresco.rmi.services.external.host=server2@domain
alfresco.ehcache.rmi.port=40001
alfresco.ehcache.rmi.remoteObjectPort=45001
and on 'server2' -
# Ehcache Settings
alfresco.cluster.name=cluster1
index.recovery.mode = AUTO
alfresco.ehcache.rmi.hostname=server1@domain
alfresco.rmi.services.external.host=server1@domain
alfresco.ehcache.rmi.port=40001
alfresco.ehcache.rmi.remoteObjectPort=45001
I have also changed the cacheManagerPeerProviderFactory definition to below -
but this is not working. Is it possible to get the ehcache replication working out of the box and if yes, how can I achieve this? If this cannot work without JGroups, is it possible to do it some other way?
My alfresco-global.properties on 'server1' has the below lines -
# Ehcache Settings
alfresco.cluster.name=cluster1
index.recovery.mode = AUTO
alfresco.ehcache.rmi.hostname=server2@domain
alfresco.rmi.services.external.host=server2@domain
alfresco.ehcache.rmi.port=40001
alfresco.ehcache.rmi.remoteObjectPort=45001
and on 'server2' -
# Ehcache Settings
alfresco.cluster.name=cluster1
index.recovery.mode = AUTO
alfresco.ehcache.rmi.hostname=server1@domain
alfresco.rmi.services.external.host=server1@domain
alfresco.ehcache.rmi.port=40001
alfresco.ehcache.rmi.remoteObjectPort=45001
I have also changed the cacheManagerPeerProviderFactory definition to below -
<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=automatic,
multicastGroupAddress=230.0.0.1,
multicastGroupPort=4447"/>
but this is not working. Is it possible to get the ehcache replication working out of the box and if yes, how can I achieve this? If this cannot work without JGroups, is it possible to do it some other way?
However it was never very easy and that's one of the reasons alfresco replaced the clustering code. You can't just add the obsolete configuration to Alfresco Community and expect it to work.