The following sections give an overview of ready to use Ehcache configurations for session replication packaged in the 3DS Server distribution.
ehcache-no-replication.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | <? xml version = "1.0" ?> < ehcache updateCheck = "false" monitoring = "autodetect" dynamicConfig = "false" > < cache name = "pResCardRangeData" maxEntriesLocalHeap = "0" eternal = "true" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" > < searchable > < searchAttribute name = "startRange" expression = "key.getStartRange()" /> < searchAttribute name = "endRange" expression = "key.getEndRange()" /> < searchAttribute name = "directoryServerUrl" expression = "key.getDirectoryServerUrl()" /> </ searchable > </ cache > < cache name = "pResDsData" maxEntriesLocalHeap = "0" eternal = "true" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" > </ cache > < cache name = "threeDSMethodData" maxEntriesLocalHeap = "6000" timeToLiveSeconds = "60" timeToIdleSeconds = "60" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" eternal = "false" > </ cache > < cache name = "resultsData" maxEntriesLocalHeap = "120000" timeToLiveSeconds = "1800" timeToIdleSeconds = "1800" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" eternal = "false" > </ cache > </ ehcache > |
ehcache-rmi-async.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | <? xml version = "1.0" ?> < ehcache updateCheck = "false" monitoring = "autodetect" dynamicConfig = "false" > < cacheManagerPeerProviderFactory class = "net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory" properties=" peerDiscovery = automatic , multicastGroupAddress = 239 .195.255.255, multicastGroupPort = 4446 , timeToLive = 32 "/> < cacheManagerPeerListenerFactory class = "net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" /> < cache name = "pResCardRangeData" maxEntriesLocalHeap = "0" eternal = "true" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.RMICacheReplicatorFactory" properties=" replicateAsynchronously = true , asynchronousReplicationIntervalMillis = 100 , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> < searchable > < searchAttribute name = "startRange" expression = "key.getStartRange()" /> < searchAttribute name = "endRange" expression = "key.getEndRange()" /> < searchAttribute name = "directoryServerUrl" expression = "key.getDirectoryServerUrl()" /> </ searchable > </ cache > < cache name = "pResDsData" maxEntriesLocalHeap = "0" eternal = "true" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.RMICacheReplicatorFactory" properties=" replicateAsynchronously = true , asynchronousReplicationIntervalMillis = 100 , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> </ cache > < cache name = "threeDSMethodData" maxEntriesLocalHeap = "6000" timeToLiveSeconds = "60" timeToIdleSeconds = "60" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" eternal = "false" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.RMICacheReplicatorFactory" properties=" replicateAsynchronously = true , asynchronousReplicationIntervalMillis = 100 , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> </ cache > < cache name = "resultsData" maxEntriesLocalHeap = "120000" timeToLiveSeconds = "1800" timeToIdleSeconds = "1800" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" eternal = "false" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.RMICacheReplicatorFactory" properties=" replicateAsynchronously = true , asynchronousReplicationIntervalMillis = 100 , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> </ cache > </ ehcache > |
ehcache-rmi-sync.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | <? xml version = "1.0" ?> < ehcache updateCheck = "false" monitoring = "autodetect" dynamicConfig = "false" > < cacheManagerPeerProviderFactory class = "net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory" properties=" peerDiscovery = automatic , multicastGroupAddress = 239 .195.255.255, multicastGroupPort = 4446 , timeToLive = 32 "/> < cacheManagerPeerListenerFactory class = "net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" /> < cache name = "pResCardRangeData" maxEntriesLocalHeap = "0" eternal = "true" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" > < searchable > < searchAttribute name = "startRange" expression = "key.getStartRange()" /> < searchAttribute name = "endRange" expression = "key.getEndRange()" /> < searchAttribute name = "directoryServerUrl" expression = "key.getDirectoryServerUrl()" /> </ searchable > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.RMICacheReplicatorFactory" properties=" replicateAsynchronously = false , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> </ cache > < cache name = "pResDsData" maxEntriesLocalHeap = "0" eternal = "true" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.RMICacheReplicatorFactory" properties=" replicateAsynchronously = false , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> </ cache > < cache name = "threeDSMethodData" maxEntriesLocalHeap = "6000" timeToLiveSeconds = "60" timeToIdleSeconds = "60" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" eternal = "false" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.RMICacheReplicatorFactory" properties=" replicateAsynchronously = false , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> </ cache > < cache name = "resultsData" maxEntriesLocalHeap = "120000" timeToLiveSeconds = "1800" timeToIdleSeconds = "1800" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" eternal = "false" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.RMICacheReplicatorFactory" properties=" replicateAsynchronously = false , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> </ cache > </ ehcache > |
For more information about RMI and Ehcache consult Ehcache RMI Replicated Caching page.
ehcache-tcp-async.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | <? xml version = "1.0" encoding = "UTF-8" ?> < ehcache updateCheck = "false" name = "JGroupsCache" > < cacheManagerPeerProviderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory" properties=" connect = TCP ( bind_port = 7800 ; bind_addr = localhost ): TCPPING( initial_hosts = localhost [7800],localhost[7801]; port_range = 1 ; timeout = 3000 ; num_initial_members = 3 ): FD( timeout = 3000 ; max_tries = 2 ): VERIFY_SUSPECT( timeout = 1500 ): STATS: pbcast.NAKACK( retransmit_timeout = 3000 ; use_mcast_xmit = false ): UNICAST: pbcast.GMS( join_timeout = 5000 ; print_local_addr = true )" propertySeparator = "::" /> < cache name = "pResCardRangeData" maxEntriesLocalHeap = "0" eternal = "true" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties=" replicateAsynchronously = true , asynchronousReplicationIntervalMillis = 100 , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> < searchable > < searchAttribute name = "startRange" expression = "key.getStartRange()" /> < searchAttribute name = "endRange" expression = "key.getEndRange()" /> < searchAttribute name = "directoryServerUrl" expression = "key.getDirectoryServerUrl()" /> </ searchable > </ cache > < cache name = "pResDsData" maxEntriesLocalHeap = "0" eternal = "true" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties=" replicateAsynchronously = true , asynchronousReplicationIntervalMillis = 100 , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> </ cache > < cache name = "threeDSMethodData" maxEntriesLocalHeap = "6000" timeToLiveSeconds = "60" timeToIdleSeconds = "60" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" eternal = "false" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties=" replicateAsynchronously = true , asynchronousReplicationIntervalMillis = 100 , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> </ cache > < cache name = "resultsData" maxEntriesLocalHeap = "120000" timeToLiveSeconds = "1800" timeToIdleSeconds = "1800" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" eternal = "false" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties=" replicateAsynchronously = true , asynchronousReplicationIntervalMillis = 100 , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> </ cache > </ ehcache > |
ehcache-tcp-sync.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | <? xml version = "1.0" encoding = "UTF-8" ?> < ehcache updateCheck = "false" name = "JGroupsCache" > < cacheManagerPeerProviderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory" properties=" connect = TCP ( bind_port = 7800 ; bind_addr = localhost ): TCPPING( initial_hosts = localhost [7800],localhost[7801]; port_range = 1 ; timeout = 3000 ; num_initial_members = 3 ): FD( timeout = 3000 ; max_tries = 2 ): VERIFY_SUSPECT( timeout = 1500 ): STATS: pbcast.NAKACK( retransmit_timeout = 3000 ; use_mcast_xmit = false ): UNICAST: RSVP: pbcast.GMS( join_timeout = 5000 ; print_local_addr = true )" propertySeparator = "::" /> < cache name = "pResCardRangeData" maxEntriesLocalHeap = "0" eternal = "true" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties=" replicateAsynchronously = false , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> < searchable > < searchAttribute name = "startRange" expression = "key.getStartRange()" /> < searchAttribute name = "endRange" expression = "key.getEndRange()" /> < searchAttribute name = "directoryServerUrl" expression = "key.getDirectoryServerUrl()" /> </ searchable > </ cache > < cache name = "pResDsData" maxEntriesLocalHeap = "0" eternal = "true" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties=" replicateAsynchronously = false , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> </ cache > < cache name = "threeDSMethodData" maxEntriesLocalHeap = "6000" timeToLiveSeconds = "60" timeToIdleSeconds = "60" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" eternal = "false" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties=" replicateAsynchronously = false , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> </ cache > < cache name = "resultsData" maxEntriesLocalHeap = "120000" timeToLiveSeconds = "1800" timeToIdleSeconds = "1800" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" eternal = "false" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties=" replicateAsynchronously = false , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> </ cache > </ ehcache > |
Verify that IP Multicasting is enabled and nodes can find them self on designated addresses and ports.
NOTE: You need to set bind_addr
property on the cacheManagerPeerProviderFactory
if you want to bind to a specific network interface card (NIC). (check It doesn't work section for more details)
ehcache-udp-async.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | <? xml version = "1.0" ?> < ehcache updateCheck = "false" monitoring = "autodetect" dynamicConfig = "false" > < cacheManagerPeerProviderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory" properties=" connect = UDP ( mcast_addr = 239 .195.255.255; mcast_port = 7600 ; ip_ttl = 32 ; mcast_send_buf_size = 150000 ; mcast_recv_buf_size = 80000 ): PING( timeout = 2000 ; num_initial_members = 3 ): MERGE2( min_interval = 5000 ; max_interval = 10000 ): FD_SOCK: VERIFY_SUSPECT( timeout = 1500 ): STATS: pbcast.NAKACK: UNICAST: pbcast.STABLE( desired_avg_gossip = 20000 ): FRAG: pbcast.GMS( join_timeout = 5000 ; print_local_addr = true )" propertySeparator = "::" /> < cache name = "pResCardRangeData" maxEntriesLocalHeap = "0" eternal = "true" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties=" replicateAsynchronously = true , asynchronousReplicationIntervalMillis = 100 , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> < searchable > < searchAttribute name = "startRange" expression = "key.getStartRange()" /> < searchAttribute name = "endRange" expression = "key.getEndRange()" /> < searchAttribute name = "directoryServerUrl" expression = "key.getDirectoryServerUrl()" /> </ searchable > </ cache > < cache name = "pResDsData" maxEntriesLocalHeap = "0" eternal = "true" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties=" replicateAsynchronously = true , asynchronousReplicationIntervalMillis = 100 , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> </ cache > < cache name = "threeDSMethodData" maxEntriesLocalHeap = "6000" timeToLiveSeconds = "60" timeToIdleSeconds = "60" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" eternal = "false" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties=" replicateAsynchronously = true , asynchronousReplicationIntervalMillis = 100 , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> </ cache > < cache name = "resultsData" maxEntriesLocalHeap = "120000" timeToLiveSeconds = "1800" timeToIdleSeconds = "1800" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" eternal = "false" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties=" replicateAsynchronously = true , asynchronousReplicationIntervalMillis = 100 , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> </ cache > </ ehcache > |
ehcache-udp-sync.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | <? xml version = "1.0" ?> < ehcache updateCheck = "false" monitoring = "autodetect" dynamicConfig = "false" > < cacheManagerPeerProviderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory" properties=" connect = UDP ( mcast_addr = 239 .195.255.255; mcast_port = 7600 ; ip_ttl = 32 ; mcast_send_buf_size = 150000 ; mcast_recv_buf_size = 80000 ): PING( timeout = 2000 ; num_initial_members = 3 ): MERGE2( min_interval = 5000 ; max_interval = 10000 ): FD_SOCK: VERIFY_SUSPECT( timeout = 1500 ): STATS: pbcast.NAKACK: UNICAST: RSVP: pbcast.STABLE( desired_avg_gossip = 20000 ): FRAG: pbcast.GMS( join_timeout = 5000 ; print_local_addr = true )" propertySeparator = "::" /> < cache name = "pResCardRangeData" maxEntriesLocalHeap = "0" eternal = "true" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties=" replicateAsynchronously = false , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> < searchable > < searchAttribute name = "startRange" expression = "key.getStartRange()" /> < searchAttribute name = "endRange" expression = "key.getEndRange()" /> < searchAttribute name = "directoryServerUrl" expression = "key.getDirectoryServerUrl()" /> </ searchable > </ cache > < cache name = "pResDsData" maxEntriesLocalHeap = "0" eternal = "true" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties=" replicateAsynchronously = false , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> </ cache > < cache name = "threeDSMethodData" maxEntriesLocalHeap = "6000" timeToLiveSeconds = "60" timeToIdleSeconds = "60" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" eternal = "false" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties=" replicateAsynchronously = false , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> </ cache > < cache name = "resultsData" maxEntriesLocalHeap = "120000" timeToLiveSeconds = "1800" timeToIdleSeconds = "1800" memoryStoreEvictionPolicy = "LRU" diskPersistent = "false" overflowToDisk = "false" maxElementsOnDisk = "0" eternal = "false" > < cacheEventListenerFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties=" replicateAsynchronously = false , replicatePuts = true , replicatePutsViaCopy = true , replicateUpdates = true , replicateUpdatesViaCopy = true , replicateRemovals = true "/> < bootstrapCacheLoaderFactory class = "net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" properties = "bootstrapAsynchronously=false" /> </ cache > </ ehcache > |
The use of an Ehcache configuration for session replication can be configured via 3DS Server Configuration Properties:
ehcache.config-xml.resource-location=[configuration_to_be_used]
To use one of the packaged configurations (e.g. ehcache-rmi-sync.xml), set the property as follows:
ehcache.config-xml.resource-location=classpath:ehcache-rmi-sync.xml
To use a custom configuration (e.g. /etc/3dss/ehcache.xml), set the property as follows:
ehcache.config-xml.resource-location=file:/etc/3dss/ehcache.xml
If you don't specify a configuration for session replication, the configuration found under $THREEDS_CONFIG_HOME/ehcache.xml
is used.
When deciding which replication strategy to choose (RMI, JGroups TCP or JGroups UDP), consider the setup of your network infrastructure and the required features from the replication:
ehcache-rmi-sync.xml
configuration is recommended.-Djava.net.preferIP4Stack=true
property when starting the nodes.