commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Drew Leamon <aplea...@gmail.com>
Subject [JCS] Remote Cache Server Help
Date Mon, 12 Nov 2012 15:28:25 GMT
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!

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message