cancel
Showing results for 
Search instead for 
Did you mean: 

EHCache Replication using JGroups over TCP ?

deepak1987
Star Contributor
Star Contributor
What is the difference between Default EHCache Replication using JGroups over TCP protocol and Alfresco's implemenation for EHCache Replication using JGroups over TCP protocol ?


I mean to say,
In alfresco-global.properties file,  I have configured JGroups for Ehcache Replication using TCP protocol:


alfresco.cluster.name = alfrescocluster
alfresco.jgroups.defaultProtocol = TCP
alfresco.tcp.initial_hosts = host_1[7800],host_2[7800]
alfresco.jgroups.bind_address = host_1
alfresco.tcp.start_port = 7800

and

In ehcache-custom.xml file,
1) CacheManagerPeerProviderFactory class is org.alfresco.repo.cache.AlfrescoCacheManagerPeerProviderFactory.
2) CacheManagerPeerListenerFactory class is net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory.
3) CacheEventListenerFactory class is net.sf.ehcache.distribution.RMICacheReplicatorFactory.


<cacheManagerPeerProviderFactory
         class="org.alfresco.repo.cache.AlfrescoCacheManagerPeerProviderFactory"
         properties="heartbeatInterval=5000,
                          peerDiscovery=automatic,
                          multicastGroupAddress=230.0.0.1,
                          multicastGroupPort=4446"
/>

<cacheManagerPeerListenerFactory
                                  class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
                                  properties="socketTimeoutMillis=10000"
/>

<defaultCache
       …
   >
             <cacheEventListenerFactory
                         class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
                          properties="replicatePuts = false,
                                replicateUpdates = true,
                                replicateRemovals = true,
                                replicateUpdatesViaCopy = false,
                                replicateAsynchronously = false"/>
</defaultCache>


If I use default classes of Ehcache for replication using JGroups over TCP
as
1) CacheManagerPeerProviderFactory = net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory.
2) CacheEventListenerFactory = net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory.

I have got the following configuration from
http://www.ehcache.org/documentation/replication/jgroups-replicated-caching#example-configuration-us...

 
<cacheManagerPeerProviderFactory
          class="net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory"
          properties="connect=TCP(bind_port=7800):
                            TCPPING(initial_hosts=host_1[7800],host_2[7800];port_range=10;timeout=3000;
                                          num_initial_members=3):
                            VERIFY_SUSPECT(timeout=1500):
                            pbcast.NAKACK(retransmit_timeout=3000):
                            pbcast.GMS(join_timeout=5000;print_local_addr=false)" 
           propertySeparator="::"
/>

<defaultCache
             ….
         > 
            <cacheEventListenerFactory
                       class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
                       properties="replicatePuts = false,
                                         replicateUpdates = true,
                                         replicateRemovals = true,
                                         replicateUpdatesViaCopy = false,
                                         replicateAsynchronously = false" />

</defaultCache>


Will it impact on performance while replicating caches on nodes in a cluster??
If YES then, how and why ?

I tried with above configuration using Default implementation of Ehcache instead of Alfresco's method and did testing by following instructions in https://wiki.alfresco.com/wiki/Cluster_Configuration_V2.1.3_and_Later#Testing_the_cluster. It worked, but not sure about pros and cons.

Has anybody tried or did such kind of experiment??

Your inputs are highly appreciated.
1 REPLY 1

jspuchau
Champ in-the-making
Champ in-the-making
Hi, I dont know if that stuff is going to work, but you can check them more extensively using the jconsole in both nodes to check if the objects are correctly replicating from one node to another.

If you test with persisted objects you can obtain false positives as the information is being persisted. Not persisted objects as user sessions are better indicators to test if the cache is replicating.

Regards
JSP
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.