Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 35110200CD2 for ; Thu, 27 Jul 2017 18:15:24 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 338E616951D; Thu, 27 Jul 2017 16:15:24 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 531AE169514 for ; Thu, 27 Jul 2017 18:15:23 +0200 (CEST) Received: (qmail 36468 invoked by uid 500); 27 Jul 2017 16:15:22 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 36456 invoked by uid 99); 27 Jul 2017 16:15:21 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jul 2017 16:15:21 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 701191807D8 for ; Thu, 27 Jul 2017 16:15:21 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.629 X-Spam-Level: ** X-Spam-Status: No, score=2.629 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 9iMiqs2yj8dE for ; Thu, 27 Jul 2017 16:15:18 +0000 (UTC) Received: from mail-qk0-f174.google.com (mail-qk0-f174.google.com [209.85.220.174]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 501845F3F2 for ; Thu, 27 Jul 2017 16:15:18 +0000 (UTC) Received: by mail-qk0-f174.google.com with SMTP id d136so109574880qkg.3 for ; Thu, 27 Jul 2017 09:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=LeAnZgQdraHcYemX3nu4pcNStp6R3PkKdjTuG3st4+A=; b=n7uckG+d6Bv20axFx7Bcnw9n1xDvKMqPlobb2aFhgWf6m9fAREvkf2N+XaQGwi/j4y WqyfOhF2Bx6uBW+tLiNgqPMGpVOp35Agcr6AU1WnX++PPmOmVM5OqiNPgP6BDQu2nGvw MkWpxVaEp5mQNaI9Q5uhjZFPSGjj8cijmtmFEwcy8gFc+QSPllktGHK5o4NtwxI3jT11 OniEZwG2yrkHhjktz2LB9epJlXfKDI15L7se4VCFoCPQ4aeCeQZYV0H4G5Zj5cs4OejW 0iAT+/IZpBZOYBgLuaA7CSDqv1qOE47tYid753CqT28NrKpVn37JcntauBlLftqJ03TP 8OnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=LeAnZgQdraHcYemX3nu4pcNStp6R3PkKdjTuG3st4+A=; b=YwxkJQS2uQL37VN1j89Om1J6c8GFsJeiFzGls6jBN2NLIEAhKvbUu98cph25VW2o85 u6scq+apeI+1KbJLhTg2Jc8TlKbANT6yhPLUs01cSM7x2lLsJeqs8+xM33mUNANpIvYb mxZpvo4/wTp8jk671wrgXUTOg64CnAZ14+reZpCFAhZfjt+W+r+rsrS21bgLbz+TxG1S jfh63QBpyXhBelMBVD812OHh8lK1b4AP+NcoLWe2A2GR4muNv25JOE97Qq+sH1pYcARe FSlyNUqspxV+AkkkEWSV83y1auJR8zUeQVCWXABOYI13hnsqtjWuPnjiJzGPJIzxGvP+ F21g== X-Gm-Message-State: AIVw113vLIrraHSI+gO1c6ZUxOT6iGfrJHzTc9JHUpx8KYxIrfjvVkuT zbTfmQhaBk5y8hoy7no= X-Received: by 10.55.162.210 with SMTP id l201mr7091925qke.180.1501172111562; Thu, 27 Jul 2017 09:15:11 -0700 (PDT) Received: from [192.168.2.112] ([142.166.23.178]) by smtp.gmail.com with ESMTPSA id q68sm13402537qkf.1.2017.07.27.09.15.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jul 2017 09:15:10 -0700 (PDT) From: Greg Parker Content-Type: multipart/alternative; boundary="Apple-Mail=_4ADBF61F-4969-4D01-A934-DDAFF6BBD2C4" Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: JCS LateralTCPCacheFactory Date: Thu, 27 Jul 2017 13:15:07 -0300 References: <4033f08d-5af1-4e41-8f94-56e6952e44e1@email.android.com> <8C91FC97-E453-4962-A961-D7267DA419BA@gmail.com> To: Commons Users List In-Reply-To: Message-Id: <81559726-713A-40E9-BB74-C330725AE239@gmail.com> X-Mailer: Apple Mail (2.3273) archived-at: Thu, 27 Jul 2017 16:15:24 -0000 --Apple-Mail=_4ADBF61F-4969-4D01-A934-DDAFF6BBD2C4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I reverted the ports back to the way they were and the SEVERE error goes = away. I also get some lateral caching going on but its very erratic. = In my test, server A is the only instance that writes to the cache. Scenario 1 - success - Start server A, B, C - Access server B - Access server C - Access server A to put value in cache - Server B and C display the value put by A Scenaio 2 - fail - Start server A, B, C - Access server A to put value in cache - console displays connection exceptions - Access server B - Access server C - Access server A to remove then put value to cache - Server B and C displays null Scenaio 3 - fail - Start server A, B, C - Access server B - Access server C - Access server A to put value in cache - Server B and C display the value put by A - Restart server B - Access server A to put value in cache - server A displays exception about connection to B - Server B displays null Just wondering if perhaps I have some fundamental misunderstanding about = how the lateral caching should be working. I would assume that values = written to any of the local caches would be pushed into the other two. = When a instance restarts it would rejoin the group etc. Am I missing = something? Thanks > On Jul 27, 2017, at 12:00 PM, Mat Jaggard = wrote: >=20 > Have you tested to see if any of the the TcpListenerPorts are open on = your > server? If you're on Linux you can try `netstat -l` >=20 > On Thu, 27 Jul 2017 at 15:52 Russell Sherk = > wrote: >=20 >> Hi Greg, >>=20 >> Don't know much about JCS. Just general Tomcat stuff. >>=20 >> See if this helps: >> = http://sentineltechsupport.gemalto.com/2013/10/java-runtime-log-error-coul= d-not-instantiate-auxfactory-named-dc/ >>=20 >> If not, maybe someone else in the list can help. >>=20 >> Cheers, >>=20 >> --Russ >>=20 >> -----Original Message----- >> From: Greg Parker [mailto:gmparker2000@gmail.com] >> Sent: July-27-17 10:07 AM >> To: Commons Users List >> Subject: Re: JCS LateralTCPCacheFactory >>=20 >> Thanks Russ, >>=20 >> So the TcpListenerPort value should match the tomcat port? So if = tomcat >> is running on port 6080 the cache.ccf on that instance should set >> TcpListenerPort=3D6080? I set things up this way and nothing seems = to >> complain; however, now I get a SEVERE error on first access and = caching is >> not working across the three instances. Here are the details: >>=20 >> SEVERE [ajp-nio-6009-exec-1] >> = org.apache.commons.jcs.engine.control.CompositeCacheConfigurator.parseAuxi= liary >> Could not instantiate auxiliary cache named "hello". >>=20 >> jcs.region.hello=3DLTCP >>=20 >> = jcs.region.hello.cacheattributes=3Dorg.apache.commons.jcs.engine.Composite= CacheAttributes >> jcs.region.hello.cacheattributes.MaxObjects=3D1000 >>=20 >> = jcs.region.hello.cacheattributes.MemoryCacheName=3Dorg.apache.commons.jcs.= engine.memory.lru.LRUMemoryCache >> jcs.region.hello.cacheattributes.UseMemoryShrinker=3Dtrue >> jcs.region.hello.cacheattributes.MaxMemoryIdleTimeSeconds=3D3600 >> jcs.region.hello.cacheattributes.ShrinkerIntervalSeconds=3D60 >> jcs.region.hello.cacheattributes.MaxSpoolPerRun=3D500 >>=20 >> = jcs.region.hello.elementattributes=3Dorg.apache.commons.jcs.engine.Element= Attributes >> jcs.region.hello.elementattributes.IsEternal=3Dfalse >>=20 >>=20 >>=20 >> = jcs.auxiliary.LTCP=3Dorg.apache.commons.jcs.auxiliary.lateral.socket.tcp.L= ateralTCPCacheFactory >>=20 >> = jcs.auxiliary.LTCP.attributes=3Dorg.apache.commons.jcs.auxiliary.lateral.s= ocket.tcp.TCPLateralCacheAttributes >> jcs.auxiliary.LTCP.attributes.UdpDiscoveryEnabled=3Dfalse >> jcs.auxiliary.LTCP.attributes.AllowGet=3Dtrue >> jcs.auxiliary.LTCP.attributes.Receive=3Dtrue >> jcs.auxiliary.LTCP.attributes.TcpListenerPort=3D6080 >> = jcs.auxiliary.LTCP.attributes.TcpServers=3Dlocalhost:7080,localhost:8080 >>=20 >> Thanks >>=20 >>=20 >>=20 >>> On Jul 27, 2017, at 8:57 AM, Russell Sherk = >> wrote: >>>=20 >>> Hi Greg, >>>=20 >>> Tomcat uses two consecutive ports. The one you specify and the next = one >> for shutdown. E.g if you specify 8020, the shutdown port by default = is 8021. >>>=20 >>> Try spacing your ports out: 8020, 8022, 8024. >>>=20 >>> --Russ >>>=20 >>>=20 >>> On Jul 26, 2017 10:11 PM, Greg Parker = wrote: >>> I'm trying to get a sample cluster of tomcat servers (server A, B = and C) >> to use a distributed cache. The =E2=80=98hello=E2=80=99 cache is = configured on each server >> with a different TcpListenerPort on each server (8020, 8021, 8022) = like >> this: >>>=20 >>> jcs.region.hello=3DLTCP >>> =E2=80=A6 >>>=20 >>> = jcs.auxiliary.LTCP=3Dorg.apache.commons.jcs.auxiliary.lateral.socket.tcp >>> .LateralTCPCacheFactory >>> = jcs.auxiliary.LTCP.attributes=3Dorg.apache.commons.jcs.auxiliary.lateral >>> .socket.tcp.TCPLateralCacheAttributes >>> jcs.auxiliary.LTCP.attributes.UdpDiscoveryEnabled=3Dfalse >>> jcs.auxiliary.LTCP.attributes.AllowGet=3Dtrue >>> jcs.auxiliary.LTCP.attributes.Receive=3Dtrue >>> jcs.auxiliary.LTCP.attributes.TcpListenerPort=3D8020 >>> = jcs.auxiliary.LTCP.attributes.TcpServers=3Dlocalhost:8020,localhost:8021 >>> ,localhost:8022 >>>=20 >>>=20 >>> Server A has a page that sets a value in the cache like this: >>>=20 >>> cache =3D JCS.getInstance("hello"); >>> cache.put(=E2=80=9Cmessage", =E2=80=9CHello from server A"); >>>=20 >>>=20 >>> Server B, and C try to get the value without setting it: >>>=20 >>> cache =3D JCS.getInstance("hello"); >>> add(new Label("message", "Server B -> cache has : " + >>> cache.get(=E2=80=9Cmessage");)); >>>=20 >>>=20 >>> The first time I access the page on server A I get an exception - >> "Cannot connect to localhost:8021=E2=80=9D. If I access the page on = each server >> then things appear to start communicating; however, the =E2=80=9Cmessag= e=E2=80=9D entry >> from the =E2=80=9Chello=E2=80=9D region is set on server A and null = on B and C. Sometimes >> I see the value on server C displayed properly but never on server B. >>>=20 >>> With a configuration like this should I expect to see values = immediately >> distributed to the other servers? >>>=20 >>> Is there a way I should be bootstrapping the cache when the server >> starts? If the servers need to communicate with one another it would = seem >> to me that they need to be listening long before the first time the = server >> tries to access the cache. >>>=20 >>> For performance I would like to use the cache to store serialized = XML >> data instead of storing it in the session or a database. The data = remains >> in the cache while the user transforms it through several request = cycles. >> So during a request cycle the XML data would be retrieved, = transformed, and >> stored back in the cache. In a clustered environment I need the XML = data >> available on every server in the cluster. Is this an acceptable use = case >> for JCS? >>>=20 >>> Thanks >>>=20 >>>=20 >>>=20 >>>=20 >>=20 >>=20 --Apple-Mail=_4ADBF61F-4969-4D01-A934-DDAFF6BBD2C4--