commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amol D (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCS-192) Failover Mechanism not working with Remote Auxillary Cache
Date Mon, 03 Sep 2018 06:55:00 GMT

    [ https://issues.apache.org/jira/browse/JCS-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16601818#comment-16601818
] 

Amol D commented on JCS-192:
----------------------------

Following configurations worked for me in terms of JCS failover - 1.3 version 

Primary Server cache.ccf 
----------------------------------------------------------------------------------------------------------------------------------
Cache.ccf 
# sets the default aux value for any non configured caches

jcs.default=DC,RCluster1,RFailover
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=20000

jcs.default.elementattributes.IsSpool=false
# Registry used to register and provide the IRemoteCacheService service.
#registry.host=PRIMARY_REMOTE_SERVER_NAME_OR_IP
registry.host=localhost
#registry.port=PRIMARY_REMOTE_SERVER_PORT_TO_START_RMI_SERVICE
registry.port=1023
# call back port to local caches.
#remote.cache.service.port=USE_SAME_AS_REGISTRY_PORT_ABOVE
remote.cache.service.port=1023

# Uncomment the jcs.auxiliary.RCluster1 properties, when using more than one REMOTE Server
Cache
jcs.auxiliary.RCluster1=org.apache.jcs.auxiliary.remote.RemoteCacheFactory
jcs.auxiliary.RCluster1.attributes=org.apache.jcs.auxiliary.remote.RemoteCacheAttributes

# Use CLUSTER when you cluster the remote servers, local when the remote servers are used
in failover mechanism
jcs.auxiliary.RCluster1.attributes.RemoteTypeName=CLUSTER
#jcs.auxiliary.RCluster1.attributes.RemoteTypeName=LOCAL
jcs.auxiliary.RCluster1.attributes.RemoveUponRemotePut=false
# Below port should be secondary server port
jcs.auxiliary.RCluster1.attributes.ClusterServers=localhost:1024
jcs.auxiliary.RCluster1.attributes.GetOnly=false

# rmi socket factory timeout
remote.cache.rmiSocketFactoryTimeoutMillis=5000
remote.cluster.LocalClusterConsistency=true
remote.cluster.AllowClusterGet=true

# Remote RMI Cache set up to failover
jcs.auxiliary.RFailover=org.apache.jcs.auxiliary.remote.RemoteCacheFactory
jcs.auxiliary.RFailover.attributes=org.apache.jcs.auxiliary.remote.RemoteCacheAttributes
# Below port should be secondary server port
jcs.auxiliary.RFailover.attributes.FailoverServers=localhost:1024
jcs.auxiliary.RFailover.attributes.RemoveUponRemotePut=true
jcs.auxiliary.RFailover.attributes.GetOnly=false

----------------------------------------------------------------------------------------------------------------------------------

Secondary Server Cache.ccf :-

----------------------------------------------------------------------------------------------------------------------------------
# sets the default aux value for any non configured caches
#jcs.default=DC,RCluster1
jcs.default=DC,RCluster1,RFailover
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=20000

jcs.default.elementattributes.IsSpool=false

# Registry used to register and provide the IRemoteCacheService service.
#registry.host=PRIMARY_REMOTE_SERVER_NAME_OR_IP
registry.host=localhost

#registry.port=PRIMARY_REMOTE_SERVER_PORT_TO_START_RMI_SERVICE
registry.port=1024
# call back port to local caches.
#remote.cache.service.port=USE_SAME_AS_REGISTRY_PORT_ABOVE
remote.cache.service.port=1024

# Uncomment the jcs.auxiliary.RCluster1 properties, when using more than one REMOTE Server
Cache
jcs.auxiliary.RCluster1=org.apache.jcs.auxiliary.remote.RemoteCacheFactory
jcs.auxiliary.RCluster1.attributes=org.apache.jcs.auxiliary.remote.RemoteCacheAttributes

# Use CLUSTER when you cluster the remote servers, local when the remote servers are used
in failover mechanism
jcs.auxiliary.RCluster1.attributes.RemoteTypeName=CLUSTER
#jcs.auxiliary.RCluster1.attributes.RemoteTypeName=LOCAL
jcs.auxiliary.RCluster1.attributes.RemoveUponRemotePut=false
# Below port should be primary server port
jcs.auxiliary.RCluster1.attributes.ClusterServers=localhost:1023
jcs.auxiliary.RCluster1.attributes.GetOnly=false

# rmi socket factory timeout
remote.cache.rmiSocketFactoryTimeoutMillis=5000
remote.cluster.LocalClusterConsistency=true
remote.cluster.AllowClusterGet=true

# Remote RMI Cache set up to failover
jcs.auxiliary.RFailover=org.apache.jcs.auxiliary.remote.RemoteCacheFactory
jcs.auxiliary.RFailover.attributes=org.apache.jcs.auxiliary.remote.RemoteCacheAttributes
# Below port should be secondary server port
jcs.auxiliary.RFailover.attributes.FailoverServers=localhost:1023
jcs.auxiliary.RFailover.attributes.RemoveUponRemotePut=true
jcs.auxiliary.RFailover.attributes.GetOnly=false

----------------------------------------------------------------------------------------------------------------------------------
Client Configuration


jcs.default=DC
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.default.cacheattributes.MaxObjects=1000
jcs.default.elementattributes.IsSpool=false
jcs.default.cacheattributes.UseMemoryShrinker=false
jcs.default.cacheattributes.MaxMemoryIdleTime=3600
jcs.default.cacheattributes.ShrinkerInterval=60
jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes
jcs.default.elementattributes.IsEternal=false

jcs.auxiliary.RFailover=org.apache.jcs.auxiliary.remote.RemoteCacheFactory
jcs.auxiliary.RFailover.attributes=org.apache.jcs.auxiliary.remote.RemoteCacheAttributes
# Below property should hold 2 values – PrimaryServer and SecondaryServer 
jcs.auxiliary.RFailover.attributes.FailoverServers=localhost:1023,localhost:1024
jcs.auxiliary.RFailover.attributes.RemoveUponRemotePut=true
jcs.auxiliary.RFailover.attributes.GetOnly=false

# Remote JCS cache settings
jcs.region.TEST=DC,RFailover

 

 

> Failover Mechanism not working with Remote Auxillary Cache
> ----------------------------------------------------------
>
>                 Key: JCS-192
>                 URL: https://issues.apache.org/jira/browse/JCS-192
>             Project: Commons JCS
>          Issue Type: Bug
>          Components: RMI Remote Cache
>    Affects Versions: jcs-1.3, jcs-2.2
>            Reporter: Amol D
>            Priority: Critical
>         Attachments: StackTrace.txt
>
>
> 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|https://issues.apache.org/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
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message