asmuts 02/02/14 21:03:39 Added: docs/jcs RemoteAuxiliaryCache.html Log: added rough bloated word html doc on the remote cache Revision Changes Path 1.1 jakarta-turbine-stratum/docs/jcs/RemoteAuxiliaryCache.html Index: RemoteAuxiliaryCache.html =================================================================== <html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=Content-Type content="text/html; charset=windows-1252"> <meta name=ProgId content=Word.Document> <meta name=Generator content="Microsoft Word 10"> <meta name=Originator content="Microsoft Word 10"> <link rel=File-List href="RemoteAuxiliaryCache_files/filelist.xml"> <title>Remote Auxiliary Cache Client / Server</title> <!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>Aaron Smuts</o:Author> <o:LastAuthor>Aaron Smuts</o:LastAuthor> <o:Revision>2</o:Revision> <o:TotalTime>59</o:TotalTime> <o:Created>2002-02-15T04:06:00Z</o:Created> <o:LastSaved>2002-02-15T05:06:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>1237</o:Words> <o:Characters>6298</o:Characters> <o:Company>therealm</o:Company> <o:Lines>89</o:Lines> <o:Paragraphs>10</o:Paragraphs> <o:CharactersWithSpaces>7525</o:CharactersWithSpaces> <o:Version>10.2625</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:SpellingState>Clean</w:SpellingState> <w:GrammarState>Clean</w:GrammarState> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--> <style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} span.SpellE {mso-style-name:""; mso-spl-e:yes;} span.GramE {mso-style-name:""; mso-gram-e:yes;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style> <!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman";} </style> <![endif]--> </head> <body lang=EN-US style='tab-interval:.5in'> <div class=Section1> <p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight: normal'>Remote Auxiliary Cache Client / Server<o:p></o:p></b></p> <p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight: normal'><o:p> </o:p></b></p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'>Description<o:p></o:p></b></p> <p class=MsoNormal>The Remote Auxiliary Cache is an optional plug in for JCS. <span style='mso-spacerun:yes'> </span>It is intended for use in multi-tiered systems to maintain cache consistency.<span style='mso-spacerun:yes'> </span>It uses a highly reliable RMI client server framework that currently allows for up to 256 clients.<span style='mso-spacerun:yes'> </span>Using a listener id allows multiple clients running on the same machine to connect to the remote cache server.<span style='mso-spacerun:yes'> </span>All cache regions on one client share a listener per auxiliary, but register separately. <span style='mso-spacerun:yes'> </span>This minimizes the number of connections necessary and still avoids unnecessary updates for regions that are not configured to use the remote cache.</p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal>Local remote cache clients connect to the remote cache on a configurable port and register a listener to receive cache update callbacks at a configurable port.</p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal>If there is an error connecting to the remote server or if an error occurs in transmission, the client will retry for a configurable number of tires before moving into a failover-recovery mode.<span style='mso-spacerun:yes'> </span>If failover servers are configured the remote cache clients will try to register with other failover servers in a sequential order.<span style='mso-spacerun:yes'> </span>If a connection is made, the client will broadcast all relevant cache updates to the failover server while trying periodically to reconnect with the primary server.<span style='mso-spacerun:yes'> </span>If there are no failovers configured the client will move into a zombie mode while it tries to re-establish the connection.<span style='mso-spacerun:yes'> </span>By default, the cache clients run in an optimistic mode and the failure of the communication channel is detected by an attempted update to the server.<span style='mso-spacerun:yes'> </span>A pessimistic mode is configurable so that the clients will engage in active status checks.</p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal>The remote cache server broadcasts updates to listeners other than the originating source.<span style='mso-spacerun:yes'> </span><span style='mso-spacerun:yes'> </span>If the remote cache fails to propagate an update to a client, it will retry for a configurable number of tries before de-registering the client. </p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal>The cache hub communicates with a façade that implements a zombie pattern (balking façade) to prevent blocking.<span style='mso-spacerun:yes'> </span>Puts and removals are queued and occur asynchronously in the background.<span style='mso-spacerun:yes'> </span>Get requests are synchronous and can potentially block if there is a communication problem.</p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal>By default client updates are light weight.<span style='mso-spacerun:yes'> </span>The client listeners are configured to remove elements form the local cache when there is a put order from the remote.<span style='mso-spacerun:yes'> </span>This allows the client memory store to control the memory size algorithm from local usage, rather than having the usage patterns dictated by the usage patterns in the system at large.</p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal>When using a remote cache the local cache hub will propagate elements in regions configured for the remote cache if the element attributes specify that the item to be cached can be sent remotely.<span style='mso-spacerun:yes'> </span>By default there are no remote restrictions on elements and the region will dictate the behavior.<span style='mso-spacerun:yes'> </span>The order of auxiliary requests is dictated by the order in the configuration file.<span style='mso-spacerun:yes'> </span>The examples are configured to look in memory, then disk, then remote caches.<span style='mso-spacerun:yes'> </span>Most elements will only be retrieved from the remote cache once, when they are not in memory or disk and are first requested, or after they have been invalidated. </p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'>Configuration (Client)<o:p></o:p></b></p> <p class=MsoNormal>The configuration is fairly straightforward and is done in the auxiliary cache section of the <span class=SpellE>cache.ccf</span> configuration file.<span style='mso-spacerun:yes'> </span>In the example below, I created a Remote Auxiliary Cache Client referenced by "<span class=SpellE>RFailover</span>".<span style='mso-spacerun:yes'> </span></p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal>This auxiliary cache will use localhost<span class=GramE>:1102</span> as its primary remote cache server and will attempt to failover to localhost:1103 if the primary is down.<span style='mso-spacerun:yes'> </span></p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal>Setting <span class=GramE>" <span class=SpellE>RemoveUponRemotePut</span></span>" to "false" would cause remote puts to be translated into put requests to the client region.<span style='mso-spacerun:yes'> </span>By default it is true, causing remote put requests to be issued as removes at the client level.<span style='mso-spacerun:yes'> </span>For groups the put request functions slightly differently: the item will be removed, since it is no longer valid in its current form, but the list of group elements will be updated.<span style='mso-spacerun:yes'> </span>This way the client can maintain the complete list of group elements without the burden of storing all of the referenced elements.<span style='mso-spacerun:yes'> </span>Session distribution works in this half-lazy replication mode.</p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal>Setting "<span class=SpellE>GetOnly</span>" to "true" would cause the remote cache client to stop propagating updates to the remote server, while continuing to get items from the remote store. </p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal style='margin-left:.5in'># Remote RMI Cache set up to failover<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'>jcs.auxiliary.RFailover=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheFactory<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'>jcs.auxiliary.RFailover.attributes=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheAttributes<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'>jcs.auxiliary.RFailover.attributes.FailoverServers=localhost<span class=GramE>:1102,localhost:1103</span></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE>jcs.auxiliary.RC.attributes.RemoveUponRemotePut</span>=true<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE>jcs.auxiliary.RFailover.attributes.GetOnly</span>=false</p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal>This cache region is setup to use a disk cache and the remote cache configured above:</p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal style='margin-left:.5in'>#Regions <span class=SpellE>preconfirgured</span> for caching<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'>jcs.region.testCache1=<span class=SpellE>DC<span class=GramE>,RFailover</span></span><o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'>jcs.region.testCache1.cacheattributes=org.apache.stratum.jcs.engine.CompositeCacheAttributes<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'>jcs.region.testCache1.cacheattributes.MaxObjects=1000<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'>jcs.region.testCache1.cacheattributes.MemoryCacheName=org.apache.stratum.jcs.engine.memory.lru.LRUMemoryCache</p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'>Configuration (Server)<o:p></o:p></b></p> <p class=MsoNormal>The remote cache configuration is growing.<span style='mso-spacerun:yes'> </span>For now, the configuration is done at the top of the <span class=SpellE>remote.cache.ccf</span> file. <span style='mso-spacerun:yes'> </span>The <span class=SpellE>startRemoteCache</span> script passes the configuration file name to the server when it starts up.<span style='mso-spacerun:yes'> </span>The configuration parameters below will create a remote cache server that listens to port 1102 and performs call backs on the "<span class=SpellE>remote.cache.service.port</span>," also specified as port 1102.</p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal>The tomcat configuration section is evolving.<span style='mso-spacerun:yes'> </span>If "<span class=SpellE>remote.tomcat.on</span>" is set to "true" an embedded tomcat server will run within the remote cache, allowing the use of management <span class=SpellE>servlets</span>.</p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal style='margin-left:.5in'># Registry used to register and provide the <span class=SpellE>IRemoteCacheService</span> service.<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE>registry.host</span>=<span class=SpellE>localhost</span><o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE>registry.port</span>=1102<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'># <span class=GramE>call</span> back port to local caches.<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE>remote.cache.service.port</span>=1102<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'># <span class=GramE>tomcat</span> <span class=SpellE>config</span><o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE>remote.tomcat.on</span>=false<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'>remote.tomcat.xml=g:/dev/jakarta-turbine-stratum/bin/conf/remote.tomcat.xml<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'># <span class=GramE>cluster</span> setting<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE>remote.cluster.LocalClusterConsistency</span>=true</p> <p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p> <p class=MsoNormal>The cluster configuration section is currently considered experimental.<span style='mso-spacerun:yes'> </span>The "<span class=SpellE>LocalClusterConsistency</span>" setting tells the remote cache server if it should broadcast updates received from other cluster servers to registered local caches.</p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal>To use experimental clustering, the remote cache will have to be told what regions to cluster.<span style='mso-spacerun:yes'> </span>The configuration below will cluster all non-preconfigured regions with "RCluster1".</p> <p class=MsoNormal style='margin-left:.5in'><br> # sets the default aux value for any non configured caches<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE>jcs.default</span>=DC<span class=GramE>,RCluster1</span><o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'>jcs.default.cacheattributes=org.apache.stratum.jcs.engine.CompositeCacheAttributes<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE>jcs.default.cacheattributes.MaxObjects</span>=1000</p> <p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p> <p class=MsoNormal style='margin-left:.5in'>jcs.auxiliary.RCluster1=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheFactory<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'>jcs.auxiliary.RCluster1.attributes=org.apache.stratum.jcs.auxiliary.remote.RemoteCacheAttributes<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'>jcs.auxiliary.RCluster1.attributes.RemoteTypeName=CLUSTER<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'>jcs.auxiliary.RCluster1.attributes.RemoveUponRemotePut=false<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'>jcs.auxiliary.RCluster1.attributes.ClusterServers=localhost<span class=GramE>:1103</span><o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'>jcs.auxiliary.RCluster1.attributes.GetOnly=false</p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'>TODO<o:p></o:p></b></p> <p class=MsoNormal>The clustering behavior needs to be better defined.<span style='mso-spacerun:yes'> </span>We may want to implement clustering with lateral caches between remotes rather than remote caches talking to each other.</p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal>Though small, the remote server configuration could be a bit cleaner.</p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal>The embedded Tomcat is not workable right now.<span style='mso-spacerun:yes'> </span></p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal>Parameters need to be added for running the XML-RPC server as well.<b style='mso-bidi-font-weight:normal'><o:p></o:p></b></p> <p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p> <p class=MsoNormal><o:p> </o:p></p> </div> </body> </html>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>