jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Smuts, Aaron" <Aaron.Sm...@travelocity.com>
Subject RE: Configuring Lateral TCP Cache Using UDP Discovery for Two Physical Servers
Date Fri, 27 Apr 2007 13:56:33 GMT
It doesn't seem to be able to establish a connection to the other server
on the specified port.  

> ERROR: (LateralTCPService.java:74) - Could not create sender to
> [10.75.91.83:1112] -- Socket is null, cannot connect to
10.75.91.83:1112

Is the second server running?  Did it have errors binding to the port?
Is there a firewall?  . . . . .

> -----Original Message-----
> From: Pennstater [mailto:Mathew.R.Kline@chase.com]
> Sent: Thursday, April 26, 2007 11:25 AM
> To: jcs-users@jakarta.apache.org
> Subject: Configuring Lateral TCP Cache Using UDP Discovery for Two
> Physical Servers
> 
> 
> All,
> 
> I've searched everywhere trying to find a definitive answer to my
> questions,
> but have come up empty.  My apologizes if these questions have already
> been
> posted and answered.
> 
> Let me first describe my environment...
> 
> We have two physical W2K AdvServ servers, WSP01 = 10.75.91.82; WSP02 =
> 10.71.91.83. Each physical server runs two Tomcat 5.0.16 servers.
> Therefore, our production environment has four Tomcat servers
available
> for
> use (ports 8180 and 8181 on each server).  All web requests come into
one
> of
> the two physical servers (WSP02), where IIS performs a "home-brewed"
load
> balancing function and directs the request to one of the four Tomcats.
We
> are running JDK 1.4.2_13. JCS is version 1.2.7.9.2.  Concurrent is
version
> 1.3.4. Log4j is version 1.2.14. Commons-logging is version 1.1. These
jars
> are located in the webapp's WEB-INF\lib directory.
> 
> I have a webapp deployed to each Tomcat. This webapp will employ JCS
to
> distribute an object containing a list of rather static entries for a
drop
> down list.  This static list does get updated from time to time, but
not
> that frequently. Because of the "home-brewed" load balancing described
> above, an update to this static list could occur on any one of the
four
> Tomcat servers. When the update occurrs, the cached object is updated.
> Based on this and what I have read, I decided to use the Lateral TCP
Cache
> using the UDP Discovery mechanism.
> 
> I have successfully used this in our UAT environment, where we have
just
> one
> physical server with two Tomcat servers (ports 8180 and 8181).  Making
an
> update to the list described above shows immediately on the web page
when
> accessing each Tomcat server port.  All is good.
> 
> Now I am in the process of moving the webapp over to our production
> environment.  It looks as if the caching is working properly on one
> physical
> server (WSP01 = 10.75.91.82), but the cache is not updated on the
second
> physical server. The Tomcat logs on the second physical server report
the
> following...
> 
> INFO: (InitServlet.java:50) - User, U343625 (org = Consumer Banking
(300))
> logged in...
> INFO: (CompositeCacheManager.java:202) - Creating cache manager from
> config
> file: /cache.ccf
> INFO: (ThreadPoolManager.java:439) - thread_pool.default
PoolConfiguration
> =
> useBoundary = [true] boundarySize = [2000] maximumPoolSize = [150]
> minimumPoolSize = [4] keepAliveTime = [300000] whenBlockedPolicy =
[RUN]
> startUpSize = [4]
> INFO: (CompositeCacheConfigurator.java:158) - Setting default
auxiliaries
> to
> LTCP
> INFO: (CompositeCacheConfigurator.java:173) - setting
> defaultCompositeCacheAttributes to [ useLateral = true, useRemote =
true,
> useDisk = true, maxObjs = 1000, maxSpoolPerRun = -1, diskUsagePattern
= 0
> ]
> INFO: (CompositeCacheConfigurator.java:444) - No special
ElementAttribute
> class defined for key [jcs.default.elementattributes], using default
> class.
> INFO: (CompositeCacheConfigurator.java:186) - setting
> defaultElementAttributes to [ IS_LATERAL = true, IS_SPOOL = true,
> IS_REMOTE
> = true, IS_ETERNAL = true, MaxLifeSeconds = -1, IdleTime = -1,
CreateTime
> =
> 1177592582483, LastAccessTime = 1177592582483, getTimeToLiveSeconds()
= -
> 1,
> createTime = 1177592582483 ]
> INFO: (LRUMemoryCache.java:77) - initialized LRUMemoryCache for cache1
> INFO: (CompositeCache.java:124) - Constructed cache with name [cache1]
and
> cache attributes [ useLateral = true, useRemote = true, useDisk =
true,
> maxObjs = 1000, maxSpoolPerRun = 500, diskUsagePattern = 0 ]
> INFO: (LateralTCPCacheFactory.java:123) - Creating listener for :1111
> INFO: (LateralTCPListener.java:403) - Listening on port 1111
> INFO: (UDPDiscoveryManager.java:80) - Creating service for
address:port
> [228.5.6.9:6780]
> INFO: (UDPDiscoveryReceiver.java:107) - constructing listener,
> [228.5.6.9:6780]
> INFO: (LateralTCPCacheFactory.java:171) - Created UDPDiscoveryService
for
> TCP lateral cache.
> INFO: (CompositeCacheConfigurator.java:249) - Parsed regions [cache1]
> INFO: (CompositeCacheConfigurator.java:141) - Finished configuration
in
> 156
> ms.
> INFO: (SetupScrHelper.java:31) - Running getSetupScrItems method
> INFO: (LateralTCPCacheManager.java:100) - Instance for
> [10.75.91.82:1110:1111] is null, creating
> INFO: (LateralTCPCacheManager.java:162) - Creating TCP service, lca =
> 10.75.91.82:1110:1111
> INFO: (LateralTCPSender.java:123) - Attempting connection to
> [1JIPWSTWSP01.texas.chase.com]
> INFO: (LateralTCPCacheManager.java:246) - Created LateralCacheNoWait
for
> [10.75.91.82:1110:1111] LateralCacheNoWait = [ LateralCacheNoWait
Status
> =
> 1 cache = [ LateralCache  Cache Name [cache1] cattr =
> [10.75.91.82:1110:1111]]]
> INFO: (CacheEventQueue.java:356) - Cache event queue created:
> CacheEventQueue [listenerId=771510704, cacheName=cache1]
> 
> So, it looks like the second server was able to "discover" the first
> server
> (I'm guessing).  But then, the logs show this...
> 
> INFO: (LateralTCPCacheManager.java:100) - Instance for
> [10.75.91.83:1112:1111] is null, creating
> INFO: (LateralTCPCacheManager.java:162) - Creating TCP service, lca =
> 10.75.91.83:1112:1111
> INFO: (LateralTCPSender.java:123) - Attempting connection to
> [1JIPWSTWSP02.texas.chase.com]
> ERROR: (LateralTCPService.java:74) - Could not create sender to
> [10.75.91.83:1112] -- Socket is null, cannot connect to
10.75.91.83:1112
> ERROR: (LateralTCPCacheManager.java:180) - Failure, lateral instance
will
> use zombie service
> java.io.IOException: Socket is null, cannot connect to
10.75.91.83:1112
> 	at
>
org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPSender.init(Latera
lT
> CPSender.java:131)
> 	at
>
org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPSender.<init>(Late
ra
> lTCPSender.java:101)
> 	at
>
org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPService.<init>(Lat
er
> alTCPService.java:62)
> 	at
>
org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPCacheManager.<init
>
> LateralTCPCacheManager.java:164)
> 	at
>
org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPCacheManager.getIn
st
> ance(LateralTCPCacheManager.java:105)
> 	at
>
org.apache.jcs.auxiliary.lateral.socket.tcp.discovery.UDPDiscoveryReceiv
er
> $MessageHandler.run(UDPDiscoveryReceiver.java:321)
> 	at
>
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecuto
r.
> java:748)
> 	at java.lang.Thread.run(Thread.java:534)
> INFO: (LateralCacheMonitor.java:169) -
> LateralCacheManager.instances.size()
> = 2
> INFO: (LateralCacheMonitor.java:185) -  1- mgr.getCaches().size() = 0
> INFO: (LateralCacheMonitor.java:185) -  2- mgr.getCaches().size() = 1
> INFO: (LateralCacheMonitor.java:225) - Lateral Cache No Wait not in
error
> INFO: (CacheEventQueue.java:239) - Destroy was called after queue was
> destroyed.  Doing nothing.  Stats =  Cache Event Queue Working = true
> Alive
> = false Empty = true Size = 0
> INFO: (LateralTCPCacheManager.java:246) - Created LateralCacheNoWait
for
> [10.75.91.83:1112:1111] LateralCacheNoWait = [ LateralCacheNoWait
Status
> =
> 3 cache = [ LateralCache  Cache Name [cache1] cattr =
> [10.75.91.83:1112:1111]]]
> 
> And finally, the below messages repeat every so often...
> 
> INFO: (LateralCacheMonitor.java:169) -
> LateralCacheManager.instances.size()
> = 3
> INFO: (LateralCacheMonitor.java:185) - 1- mgr.getCaches().size() = 1
> INFO: (LateralCacheMonitor.java:208) - found LateralCacheNoWait in
error,
> LateralCacheNoWait  Status = 3 cache = [ LateralCache  Cache Name
[cache1]
> cattr =  [10.75.91.83:1113:1111] ]
>  INFO: (LateralTCPSender.java:123) - Attempting connection to
> [1JIPWSTWSP02.texas.chase.com]
> ERROR: (LateralTCPService.java:74) - Could not create sender to
> [10.75.91.83:1113] -- Socket is null, cannot connect to
10.75.91.83:1113
> ERROR: (LateralTCPCacheManager.java:305) - Can't fix Socket is null,
> cannot
> connect to 10.75.91.83:1113
> ERROR: (LateralCacheRestore.java:71) - Can't fix Can't fix Socket is
null,
> cannot connect to 10.75.91.83:1113
>  INFO: (LateralCacheMonitor.java:185) - 2- mgr.getCaches().size() = 1
>  INFO: (LateralCacheMonitor.java:208) - found LateralCacheNoWait in
error,
> LateralCacheNoWait  Status = 3 cache = [ LateralCache  Cache Name
[cache1]
> cattr =  [10.75.91.83:1112:1111] ]
> INFO: (LateralTCPSender.java:123) - Attempting connection to
> [1JIPWSTWSP02.texas.chase.com]
> ERROR: (LateralTCPService.java:74) - Could not create sender to
> [10.75.91.83:1112] -- Socket is null, cannot connect to
10.75.91.83:1112
> ERROR: (LateralTCPCacheManager.java:305) - Can't fix Socket is null,
> cannot
> connect to 10.75.91.83:1112
> ERROR: (LateralCacheRestore.java:71) - Can't fix Can't fix Socket is
null,
> cannot connect to 10.75.91.83:1112
> INFO: (LateralCacheMonitor.java:185) - 3- mgr.getCaches().size() = 1
> INFO: (LateralCacheMonitor.java:225) - Lateral Cache No Wait not in
error
> 
> Here are my 'auxiliary caches' section out of my cache.ccf files for
each
> server...
> 
> WSP01 (10.75.91.82:8180 (Tomcat 1))...
>
jcs.auxiliary.LTCP=org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTC
PC
> acheFactory
>
jcs.auxiliary.LTCP.attributes=org.apache.jcs.auxiliary.lateral.socket.tc
p.
> TCPLateralCacheAttributes
> jcs.auxiliary.LTCP.attributes.TcpListenerPort=1110
> jcs.auxiliary.LTCP.attributes.AllowGet=true
> jcs.auxiliary.LTCP.attributes.UdpDiscoveryAddr=228.5.6.9
> jcs.auxiliary.LTCP.attributes.UdpDiscoveryPort=6780
> jcs.auxiliary.LTCP.attributes.UdpDiscoveryEnabled=true
> 
> WSP01 (10.75.91.82:8181 (Tomcat 2))...
>
jcs.auxiliary.LTCP=org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTC
PC
> acheFactory
>
jcs.auxiliary.LTCP.attributes=org.apache.jcs.auxiliary.lateral.socket.tc
p.
> TCPLateralCacheAttributes
> jcs.auxiliary.LTCP.attributes.TcpListenerPort=1111
> jcs.auxiliary.LTCP.attributes.AllowGet=true
> jcs.auxiliary.LTCP.attributes.UdpDiscoveryAddr=228.5.6.9
> jcs.auxiliary.LTCP.attributes.UdpDiscoveryPort=6780
> jcs.auxiliary.LTCP.attributes.UdpDiscoveryEnabled=true
> 
> WSP02 (10.75.91.83:8180 (Tomcat 3))...
>
jcs.auxiliary.LTCP=org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTC
PC
> acheFactory
>
jcs.auxiliary.LTCP.attributes=org.apache.jcs.auxiliary.lateral.socket.tc
p.
> TCPLateralCacheAttributes
> jcs.auxiliary.LTCP.attributes.TcpListenerPort=1112
> jcs.auxiliary.LTCP.attributes.AllowGet=true
> jcs.auxiliary.LTCP.attributes.UdpDiscoveryAddr=228.5.6.9
> jcs.auxiliary.LTCP.attributes.UdpDiscoveryPort=6780
> jcs.auxiliary.LTCP.attributes.UdpDiscoveryEnabled=true
> 
> WSP02 (10.75.91.83:8181 (Tomcat 4))...
>
jcs.auxiliary.LTCP=org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTC
PC
> acheFactory
>
jcs.auxiliary.LTCP.attributes=org.apache.jcs.auxiliary.lateral.socket.tc
p.
> TCPLateralCacheAttributes
> jcs.auxiliary.LTCP.attributes.TcpListenerPort=1113
> jcs.auxiliary.LTCP.attributes.AllowGet=true
> jcs.auxiliary.LTCP.attributes.UdpDiscoveryAddr=228.5.6.9
> jcs.auxiliary.LTCP.attributes.UdpDiscoveryPort=6780
> jcs.auxiliary.LTCP.attributes.UdpDiscoveryEnabled=true
> 
> So, my first question is:  do I have the auxiliary caches set up
properly?
> Am I missing something?  I read in the JCS docs that by using UDP
> Discovery,
> you can have the same config on multiple machines.  But does that mean
the
> TcpListenerPort is the same on all Tomcats? I'm inclined to think not,
> because when I set them all to say, 1110, I get JVM_BIND exceptions.
Can
> you basically arbitrarily assign the UdpDiscoveryAddr ip and port
number
> (netstat shows the port number as not used)?  I am assuming that if my
UAT
> config file has an UdpDiscoveryAddr ip = 228.5.6.8, then I need to set
my
> Prod config file as I have above (UdpDiscoveryAddr ip = 228.5.6.9).
Is
> this
> correct?
> 
> My second question pertains to some errors I see in the logs after
> reloading
> this webapp (I reload the webapp context via Tomcat's Manager
interface).
> I
> do this manually after moving now class files in.  The context
attribute
> in
> the application.xml file has reloadable = "false".  The error is...
> 
> Apr 26, 2007 11:14:46 AM org.apache.catalina.loader.WebappClassLoader
> loadClass
> INFO: Illegal access: this web application instance has been stopped
> already
> (the eventual following stack trace is caused by an error thrown for
> debugging purposes as well as to attempt to terminate the thread which
> caused the illegal access, and has no functional impact)
> 
> This message will continue to repeat, and fills the logs pretty
quickly.
> Any ideas on how to fix this one?
> 
> I appreciate anyone taking the time to read through this lengthy post.
> Any
> help would be greatly appreciated.
> 
> Thanks,
> 
> Matt
> --
> View this message in context:
http://www.nabble.com/Configuring-Lateral-
> TCP-Cache-Using-UDP-Discovery-for-Two-Physical-Servers-
> tf3652276.html#a10202545
> Sent from the JCS - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jcs-users-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org


Mime
View raw message