Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Not A Problem
-
jcs-1.3, jcs-2.2
-
None
-
None
-
Important
Description
Currently we are using RMI Remote caching and individually i can connect to both the servers indiviadually for example in client if i set
jcs.auxiliary.RFailover.attributes.FailoverServers=127.0.0.1:5556
or
jcs.auxiliary.RFailover.attributes.FailoverServers=127.0.0.1:5555
then caching works fine
Further i connect my l client to both the servers as below
jcs.auxiliary.RFailover.attributes.FailoverServers=127.0.0.1:5556,127.0.0.1:5555
In this case whenever i cache it always gets added to Primary Server (127.0.0.1:5556) and in case Primary server goes down Caching should be based on Failover server (127.0.0.1:5555) however it is not happening . In case Primary goes down client gets a connection to secondary server (127.0.0.1:5555) is made as per below logs
12:42:32.748 [main] INFO org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager - Looking up server //127.0.0.1:5555/org.apache.commons.jcs.engine.behavior.ICacheServiceNonLocal 12:42:32.783 [main] INFO org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager - Server found: Proxy[IRemoteCacheServer,RemoteObjectInvocationHandler[UnicastRef [liveRef: [endpoint:[192.168.56.1:5555](remote),objID:[-55e49f52:1641ca4a40a:-7fff, -6827216959955041134]]]]]
However when i add a new element to JCS Cache in this case it is not reflected so failover seems to be not working as there are no memory hits . Attaching a StackTrace of log from client please provide a fix for this
Similar behavior is seen even with JCS 1.3 version
Below is our configuration for Client , Primary Server and Secondary server
--------------------------------------------------------------------------------------------------
Client Configuration - ccf
jcs.region.test=DC,RFailover
jcs.region.test.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
jcs.region.test.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache
jcs.region.test.cacheattributes.MaxObjects=1000
jcs.region.test.elementattributes.IsSpool=false
jcs.region.test.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
jcs.auxiliary.RFailover=org.apache.commons.jcs.auxiliary.remote.RemoteCacheFactory
jcs.auxiliary.RFailover.attributes=org.apache.commons.jcs.auxiliary.remote.RemoteCacheAttributes
jcs.auxiliary.RFailover.attributes.FailoverServers=127.0.0.1:5556,127.0.0.1:5555
jcs.auxiliary.RFailover.attributes.RemoveUponRemotePut=true
jcs.auxiliary.RFailover.attributes.GetOnly=false
--------------------------------------------------------------------------------------------------------------------------
Primary Server - ccf
jcs.default=DC,RCluster1
jcs.default.cacheattributes=
org.apache.commons.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=1000
registry.host=localhost
registry.port=5556
remote.cache.service.port=5556
remote.cache.rmiSocketFactoryTimeoutMillis=5000
remote.cluster.LocalClusterConsistency=true
remote.cluster.AllowClusterGet=true
jcs.auxiliary.RCluster1=
org.apache.commons.jcs.auxiliary.remote.RemoteCacheFactory
jcs.auxiliary.RCluster1.attributes=
org.apache.commons.jcs.auxiliary.remote.RemoteCacheAttributes
jcs.auxiliary.RCluster1.attributes.RemoteTypeName=CLUSTER
jcs.auxiliary.RCluster1.attributes.RemoveUponRemotePut=false
jcs.auxiliary.RCluster1.attributes.ClusterServers=localhost:5555
jcs.auxiliary.RCluster1.attributes.GetOnly=false
- Remote RMI Cache set up to failover
jcs.auxiliary.RFailover=
org.apache.commons.jcs.auxiliary.remote.RemoteCacheFactory
jcs.auxiliary.RFailover.attributes=
org.apache.commons.jcs.auxiliary.remote.RemoteCacheAttributes
jcs.auxiliary.RFailover.attributes.FailoverServers=
localhost:5555,localhost:5556
jcs.auxiliary.RC.attributes.RemoveUponRemotePut=true
jcs.auxiliary.RFailover.attributes.GetOnly=false
--------------------------------------------------------------------------------------------------
Secondary Server ccf
registry.host=localhost
registry.port=5555
remote.cache.service.port=5555
remote.cache.rmiSocketFactoryTimeoutMillis=5000
remote.cluster.LocalClusterConsistency=true
remote.cluster.AllowClusterGet=true
jcs.default=DC,RCluster1
jcs.default.cacheattributes=
org.apache.commons.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=1000
jcs.auxiliary.RCluster1=
org.apache.commons.jcs.auxiliary.remote.RemoteCacheFactory
jcs.auxiliary.RCluster1.attributes=
org.apache.commons.jcs.auxiliary.remote.RemoteCacheAttributes
jcs.auxiliary.RCluster1.attributes.RemoteTypeName=CLUSTER
jcs.auxiliary.RCluster1.attributes.RemoveUponRemotePut=false
jcs.auxiliary.RCluster1.attributes.ClusterServers=localhost:5556
jcs.auxiliary.RCluster1.attributes.GetOnly=false
jcs.auxiliary.RFailover=
org.apache.commons.jcs.auxiliary.remote.RemoteCacheFactory
jcs.auxiliary.RFailover.attributes=
org.apache.commons.jcs.auxiliary.remote.RemoteCacheAttributes
jcs.auxiliary.RFailover.attributes.FailoverServers=
localhost:5555,localhost:5556
jcs.auxiliary.RC.attributes.RemoveUponRemotePut=true
jcs.auxiliary.RFailover.attributes.GetOnly=false