You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Drew Leamon <ap...@gmail.com> on 2012/11/12 16:28:25 UTC

[JCS] Remote Cache Server Help

I'm successfully starting the RemoteCacheServer and Running a Client to
connect to it.  However, the connection seems to fail.   It looks like the
binding names don't match?

Message from Server:

INFO: Finished configuration in 169 ms.
Nov 8, 2012 3:55:25 PM
org.apache.jcs.auxiliary.remote.server.RemoteCacheServerFactory
startTheRegistry
WARNING: Problem creating registry.  It may already be started. internal
error: ObjID already in use
Nov 8, 2012 3:55:25 PM
org.apache.jcs.auxiliary.remote.server.RemoteCacheServerFactory
registerServer
INFO: Binding server to localhost:1103 with the name
org.apache.jcs.engine.behavior.ICacheServiceNonLocal



Client Message:

2012-11-09 09:39:14,220 [Thread-33] ERROR (RemoteCacheRestore.java:93) -
host=localhost; port1103;
service=org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService
2012-11-09 09:39:14,220 [Thread-33] ERROR (RemoteCacheRestore.java:93) -
host=localhost; port1103;
service=org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService

Remote Cache Config:

registry.host=localhost
registry.port=1103
remote.cache.service.port=1103
remote.cluster.LocalClusterConsistency=true
remote.cacheeventlogger=org.apache.jcs.engine.logging.CacheEventLoggerDebugLogger
remote.cacheeventlogger.attributes.logCategoryName=TestEventLogCategory

# #############################################################
# ################# DEFAULT CACHE REGION  #####################
# sets the default aux value for any non configured caches
jcs.default=DC
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=200000
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.default.cacheattributes.UseMemoryShrinker=true
jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600
jcs.default.cacheattributes.ShrinkerIntervalSeconds=60
jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes
jcs.default.elementattributes.IsEternal=false
jcs.default.elementattributes.MaxLifeSeconds=7000
jcs.default.elementattributes.IdleTime=1800
jcs.default.elementattributes.IsSpool=true
jcs.default.elementattributes.IsRemote=true
jcs.default.elementattributes.IsLateral=false


# #############################################################
# ################# CACHE REGIONS AVAILABLE ###################
jcs.region.testCache1=DC
jcs.region.testCache1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.region.testCache1.cacheattributes.MaxObjects=200002

jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
jcs.auxiliary.DC.attributes.DiskPath=/cache/remote/


Client Cache Config:

##############################################################
################## DEFAULT CACHE REGION  #####################
# sets the default aux value for any non configured caches
jcs.default=DC2,RCS
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=100
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.default.cacheattributes.UseMemoryShrinker=false
jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes
jcs.default.elementattributes.IsEternal=true
jcs.default.elementattributes.IsSpool=true
jcs.default.elementattributes.IsRemote=true
jcs.default.elementattributes.IsLateral=false


jcs.iDataCache=DC2,RCS
jcs.iDataCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.iDataCache.cacheattributes.MaxObjects=25
jcs.iDataCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.iDataCache.cacheattributes.UseMemoryShrinker=false
jcs.iDataCache.elementattributes=org.apache.jcs.engine.ElementAttributes
jcs.iDataCache.elementattributes.IsEternal=true
jcs.iDataCache.elementattributes.IsSpool=true
jcs.iDataCache.elementattributes.IsRemote=true
jcs.iDataCache.elementattributes.IsLateral=true


##############################################################
################## AUXILIARY CACHES AVAILABLE ################

# Disk Cache Using a Pooled Event Queue -- this allows you
# to control the maximum number of threads it will use.
# Each region uses 1 thread by default in the SINGLE model.
# adding more threads than regions does not help performance.
# If you want to use a separate pool for each disk cache, either use
# the single model or define a different auxiliary for each region and use
the Pooled type.
# SINGLE is generally best unless you have a huge # of regions.

jcs.auxiliary.DC2=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
jcs.auxiliary.DC2.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
jcs.auxiliary.DC2.attributes.DiskPath=/cache/diskCache

jcs.auxiliary.DC2.attributes.MaxPurgatorySize=1000
jcs.auxiliary.DC2.attributes.MaxKeySize=100000000
jcs.auxiliary.DC2.attributes.MaxRecycleBinSize=5000
jcs.auxiliary.DC2.attributes.OptimizeAtRemoveCount=30000
jcs.auxiliary.DC2.attributes.OptimizeOnShutdown=true
jcs.auxiliary.DC2.attributes.ClearDiskOnStartup=true
jcs.auxiliary.DC2.attributes.EventQueueType=POOLED
jcs.auxiliary.DC2.attributes.EventQueuePoolName=disk_cache_event_queue

jcs.auxiliary.RCS=org.apache.jcs.auxiliary.remote.RemoteCacheFactory
jcs.auxiliary.RCS.attributes=org.apache.jcs.auxiliary.remote.RemoteCacheAttributes
jcs.auxiliary.RCS.attributes.FailoverServers=localhost:1103
jcs.auxiliary.RCS.attributes.RemoveUponRemotePut=true
jcs.auxiliary.RCS.attributes.RemoteTypeName=LOCAL
jcs.auxiliary.RCS.attributes.GetOnly=false


##############################################################
################## OPTIONAL THREAD POOL CONFIGURATION ########

# Disk Cache Event Queue Pool
# Disk Cache pool
thread_pool.disk_cache_event_queue.boundarySize=50
thread_pool.disk_cache_event_queue.useBoundary=true
thread_pool.disk_cache_event_queue.maximumPoolSize=15
thread_pool.disk_cache_event_queue.minimumPoolSize=1
thread_pool.disk_cache_event_queue.keepAliveTime=3500
thread_pool.disk_cache_event_queue.startUpSize=1
thread_pool.disk_cache_event_queue.whenBlockedPolicy=RUN


I am starting the remote cache server with the following command:

./startRemoteCache.sh /remote8.cache.ccf

I tried starting it with the port as the second parameter.  When I do that
I get an error that the port is already in use:

./startRemoteCache.sh /remote8.cache.ccf 1103

find: ./../lib: No such file or directory
Classpath =
.:./../conf:.:../../target/classes::./commons-logging-1.1.1.jar:../../target/jcs-2.0.0-SNAPSHOT.jar:../../target/classes:/usr/java/jcs/conf:/usr/java/jcs/conf/
Starting the registry on port 1103
-Xms128m -Xmx512m -verbose:gc -XX:+PrintTenuringDistribution
-Djava.security.policy=./../conf/cache.policy
propFile: /remote8.cache.ccf
is: java.io.BufferedInputStream@5abb7465
Nov 9, 2012 9:45:45 AM org.apache.jcs.auxiliary.remote.RemoteUtils
createRegistry
INFO: createRegistry> setting security manager
Nov 9, 2012 9:45:45 AM org.apache.jcs.auxiliary.remote.RemoteUtils
createRegistry
INFO: createRegistry> creating registry on port [1103]
Exception in thread "main" java.rmi.server.ExportException: Port already in
use: 1103; nested exception is:
        java.net.BindException: Address already in use
        at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:310)
        at
sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:218)
        at
sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:393)
        at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:129)
        at
sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:188)
        at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:100)
        at sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:86)
        at
java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:186)
        at
org.apache.jcs.auxiliary.remote.RemoteUtils.createRegistry(RemoteUtils.java:82)
        at
org.apache.jcs.auxiliary.remote.server.RemoteCacheServerFactory.main(RemoteCacheServerFactory.java:518)
Caused by: java.net.BindException: Address already in use
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
        at java.net.ServerSocket.bind(ServerSocket.java:328)
        at java.net.ServerSocket.<init>(ServerSocket.java:194)
        at java.net.ServerSocket.<init>(ServerSocket.java:106)
        at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createServerSocket(RMIDirectSocketFactory.java:27)
        at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createServerSocket(RMIMasterSocketFactory.java:333)
        at
sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:649)
        at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:299)
        ... 9 more


Any help as to what I'm doing wrong would be greatly appreciated!  Thanks!

Re: [JCS] Remote Cache Server Help

Posted by Drew Leamon <ap...@gmail.com>.
Not according to the documentation on the JCS website:

The remote cache configuration is growing. For now, the configuration is
done at the top of the remote.cache.ccf file. The startRemoteCache script
passes the configuration file name to the server when it starts up. The
configuration parameters below will create a remote cache server that
listens to port 1102 and performs call backs on theremote.cache.service.port ,
also specified as port 1102 .


# Registry used to register and provide the
# IRemoteCacheService service.
registry.host=localhost
registry.port=1102
# call back port to local caches.
remote.cache.service.port=1102
# rmi socket factory timeout
remote.cache.rmiSocketFactoryTimeoutMillis=5000
# cluster setting
remote.cluster.LocalClusterConsistency=true
remote.cluster.AllowClusterGet=true


On Wed, Nov 14, 2012 at 11:50 AM, Thomas Vandahl <tv...@apache.org> wrote:

> On 12.11.12 16:28, Drew Leamon wrote:
> > registry.host=localhost
> > registry.port=1103
> > remote.cache.service.port=1103
>
> Shouldn't these ports be different?
>
> Bye, Thomas.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

Re: [JCS] Remote Cache Server Help

Posted by Thomas Vandahl <tv...@apache.org>.
On 12.11.12 16:28, Drew Leamon wrote:
> registry.host=localhost
> registry.port=1103
> remote.cache.service.port=1103

Shouldn't these ports be different?

Bye, Thomas.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [JCS] Remote Cache Server Help

Posted by Thomas Vandahl <tv...@apache.org>.
On 27.11.12 16:28, Drew Leamon wrote:
> I'm embarrassed!  I just figured out the issue.  My server was using
> 2.0.0-SNAPSHOT and my client was using 1.4.0.   Sorry to waste your time.

Not at all. Thanks for telling us.

Bye, Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [JCS] Remote Cache Server Help

Posted by Drew Leamon <ap...@gmail.com>.
I'm embarrassed!  I just figured out the issue.  My server was using
2.0.0-SNAPSHOT and my client was using 1.4.0.   Sorry to waste your time.


On Tue, Nov 27, 2012 at 10:11 AM, Drew Leamon <ap...@gmail.com> wrote:

> org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService
>

Re: [JCS] Remote Cache Server Help

Posted by Drew Leamon <ap...@gmail.com>.
Thomas,
     I think that message is a red herring.  It is a warning, not an error
and then the log says that it is bound.   I think the issue is the name
that is bound.  I tried setting up the RemoteCacheServer on a linux server
instead of running it locally on OS X.  I got the same result.  I get this
message from the server:

Nov 27, 2012 9:18:59 AM
org.apache.jcs.auxiliary.remote.server.RemoteCacheServerFactory
registerServer
INFO: Binding server to localhost:1103 with the name
org.apache.jcs.engine.behavior.ICacheServiceNonLocal

And this message from the client:

2012-11-27 10:03:50,895 [btpool0-1] ERROR (RemoteCacheManager.java:163) -
Problem finding server at
[//eadashbd-wc-2d:1103/org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService]

java.rmi.NotBoundException:
org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService

at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:124)

at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)

at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:403)

at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)

at sun.rmi.transport.Transport$1.run(Transport.java:177)

at java.security.AccessController.doPrivileged(Native Method)

at sun.rmi.transport.Transport.serviceCall(Transport.java:173)


Thanks for your help.

        Drew


On Sun, Nov 18, 2012 at 3:28 PM, Thomas Vandahl <tv...@apache.org> wrote:

> On 12.11.12 16:28, Drew Leamon wrote:
> > WARNING: Problem creating registry.  It may already be started. internal
> > error: ObjID already in use
>
> Googling for the error message "ObjID already in use" gives you lots of
> results. Bottom line: The RMI registry has already been created by
> someone else in your JDK. As you cannot create a second one, your access
> attempts to the given port fail.
>
> I'm no expert in RMI, so I can only guess that this might be the case
> here. The error message s the result of a system call, so I'd be looking
> for system specifics to resolve this.
>
> Bye, Thomas.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

Re: [JCS] Remote Cache Server Help

Posted by Thomas Vandahl <tv...@apache.org>.
On 12.11.12 16:28, Drew Leamon wrote:
> WARNING: Problem creating registry.  It may already be started. internal
> error: ObjID already in use

Googling for the error message "ObjID already in use" gives you lots of
results. Bottom line: The RMI registry has already been created by
someone else in your JDK. As you cannot create a second one, your access
attempts to the given port fail.

I'm no expert in RMI, so I can only guess that this might be the case
here. The error message s the result of a system call, so I'd be looking
for system specifics to resolve this.

Bye, Thomas.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org