Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8C4879FA9 for ; Tue, 9 Dec 2014 14:18:27 +0000 (UTC) Received: (qmail 20896 invoked by uid 500); 9 Dec 2014 14:18:18 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 20536 invoked by uid 500); 9 Dec 2014 14:18:18 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 20441 invoked by uid 99); 9 Dec 2014 14:18:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Dec 2014 14:18:18 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of theo.ch@mley.fr designates 37.187.2.142 as permitted sender) Received: from [37.187.2.142] (HELO perun.aeuropeanstudent.eu) (37.187.2.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Dec 2014 14:17:52 +0000 Received: from webmail.aeuropeanstudent.eu (localhost.localdomain [127.0.0.1]) by perun.aeuropeanstudent.eu (Postfix) with ESMTP id EEA5E1216DB for ; Tue, 9 Dec 2014 15:16:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mley.fr; s=mail; t=1418134611; bh=evvxUt37ialMYp92uZtU9KABQ5VJVMEDzE+dJ4uXXbI=; h=Date:From:To:Subject:In-Reply-To:References:From; b=tN3mst4Rg0Ie3rNi6RjeoiMlJame1F/iH/QWGsYYNb3cKDI6WkLPL6FeKPvVJ9cee Raip0GO9GVB3QPMfy5vj2xY9/hWNOz4UG+jiD54uFdkY+02U4Tj+2t6VaIFTLNU0cg vyHX0Ppws35wbMHOpUaEaXPT3kF2hsSs7PLCD9SXtNZQGNmSTpZOpNGDo0ZHPXMisf 8UltEHb5o3xTw78vYVU3TN8AqQISC3ahM/dqV7GmoZ/AD3VU4RbC6v8J2GoS+9A0oQ k6oOs0g5sHrQjB889OfX7MRAIpS6EJqBndrx8KJ/NRb/ckAqZjnl0kW0RL7CPJ3hQI b6pOPj/rXALeA== MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Tue, 09 Dec 2014 15:16:50 +0100 From: =?UTF-8?Q?Th=C3=A9o_Chamley?= To: Tomcat Users List Subject: Re: Tomcat cluster with static membership In-Reply-To: References: <13a81574a06947472f1b7f7abc670f28@mley.fr> Message-ID: <919081a698211e953ab0b94bd579c5a2@mley.fr> X-Sender: theo.ch@mley.fr User-Agent: Roundcube Webmail/1.0.3 X-Virus-Checked: Checked by ClamAV on apache.org On 2014-12-08 21:22, Ameer Mawia wrote: > Hi Theo, > > Since you are using static membership and NOT dynamic(multi-cast) which > auto-detect members, my current understanding says that you will have > to > add entry of all the members of your cluster in each of nodes > server.xml. > Example: > > My cluster has two nodes. So to configure these I had add these two > members > entries in both node's server.xml(since running on the same machine, > they > have varying port with same ip): > > className="org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor"> > className="org.apache.catalina.tribes.membership.StaticMember" > port="4000" > host="192.168.1.6" > uniqueId="{10,1,0,100,0,0,0,0,0,0,0,0,0,0,0,0}"/> > > className="org.apache.catalina.tribes.membership.StaticMember" > port="4001" > host="192.168.1.6" > uniqueId="{10,1,0,101,0,0,0,0,0,0,0,0,0,0,0,0}"/> > > Regards, > Ameer Mawia > > > On Mon, Dec 8, 2014 at 8:26 PM, Théo Chamley wrote: > >> Hello, >> >> I am trying to setup a simple Tomcat cluster with static membership. I >> can't use multicast because I am on a virtualization environment that >> does >> not allow it. >> >> Debian 7 >> Tomcat 8.0.14 >> Oracle JVM 1.8.0_25 >> >> Both Tomcat are ok on their own, but I can't seem to make the >> clustering >> work: the sessions are not replicated from one to another. >> Following the official documentation, I wrote this configuration : >> >> >> > className="org.apache.catalina.ha.tcp.SimpleTcpCluster"> >> > expireSessionsOnShutdown="false" >> notifyListenersOnReplication="true" >> mapSendOptions="6"/> >> >> > address="0.0.0.0" >> port="4110" >> selectorTimeout="100" >> maxThreads="6"/> >> >> > className="org.apache.catalina.tribes.group. >> interceptors.StaticMembershipInterceptor"> >> > port="4110" >> host="my.server.1" >> domain="staging-cluster" >> >> uniqueId="{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0}"/> >> >> >> > className="org.apache.catalina.tribes.transport. >> ReplicationTransmitter"> >> >> >> > className="org.apache.catalina.tribes.group. >> interceptors.TcpFailureDetector"/> >> > className="org.apache.catalina.tribes.group. >> interceptors.MessageDispatch15Interceptor"/> >> > className="org.apache.catalina.tribes.group. >> interceptors.ThroughputInterceptor"/> >> >> > className="org.apache.catalina.ha.tcp.ReplicationValve" >> >> filter=".*\.gif|.*\.js|.*\.jpeg|.*\.jpg|.*\.png|.*\.css|. >> *\.txt"/> >> >> >> [...] >> >> >> Note: I changed the host and uniqId on the StaticMembershipInterceptor >> on >> the other Tomcat. >> >> This is not a network problem as I can telnet into the 4110 port from >> one >> server to another. >> Also, by running a tcpdump, I can't see any trafic between the two >> servers. >> >> The Tomcats seem to be doing something, because I have the following >> in my >> catalina.out: >> >> ****** >> 08-Dec-2014 15:38:15.309 INFO [main] >> org.apache.catalina.ha.tcp.SimpleTcpCluster.startInternal >> Cluster is about to start >> 08-Dec-2014 15:38:15.312 INFO [main] >> org.apache.catalina.tribes.transport.ReceiverBase.bind >> Receiver Server Socket bound to:/0.0.0.0:4110 >> 08-Dec-2014 15:38:15.328 INFO [Thread-5] >> org.apache.catalina.ha.tcp.SimpleTcpCluster.memberAdded >> Replication member added:org.apache.catalina.tribes.membership. >> StaticMember[t >> cp://my.server.1:4110,my.server.1,4110, alive=0, securePort=-1, UDP >> Port=-1, id={1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 }, payload={}, >> command={}, domain={115 116 97 >> 103 105 110 103 45 99 ...(15)}, ] >> 08-Dec-2014 15:38:15.330 INFO [main] org.apache.catalina.tribes. >> membership.McastServiceImpl.setupSocket Setting cluster mcast >> soTimeout >> to 500 >> 08-Dec-2014 15:38:15.332 INFO [main] org.apache.catalina.tribes. >> membership.McastServiceImpl.waitForMembers Sleeping for 1000 >> milliseconds >> to establish cluster membership, sta >> rt level:4 >> 08-Dec-2014 15:38:16.155 INFO [Membership-MemberAdded.] >> org.apache.catalina.ha.tcp.SimpleTcpCluster.memberAdded Replication >> member added:org.apache.catalina.tribes.membership >> .MemberImpl[tcp://{0, 0, 0, 0}:4110,{0, 0, 0, 0},4110, alive=1277686, >> securePort=-1, UDP Port=-1, id={-22 -45 110 -29 21 -22 75 95 -103 86 >> 95 >> -119 15 48 -17 -27 }, payload={} >> , command={}, domain={}, ] >> 08-Dec-2014 15:38:16.259 INFO [Tribes-Task-Receiver-1] >> org.apache.catalina.tribes.io.BufferPool.getBufferPool Created a >> buffer >> pool with max size:104857600 bytes of type: >> org.apache.catalina.tribes.io. >> BufferPool15Impl >> 08-Dec-2014 15:38:16.332 INFO [main] org.apache.catalina.tribes. >> membership.McastServiceImpl.waitForMembers Done sleeping, membership >> established, start level:4 >> 08-Dec-2014 15:38:16.335 INFO [main] org.apache.catalina.tribes. >> membership.McastServiceImpl.waitForMembers Sleeping for 1000 >> milliseconds >> to establish cluster membership, start level:8 >> 08-Dec-2014 15:38:17.335 INFO [main] org.apache.catalina.tribes. >> membership.McastServiceImpl.waitForMembers Done sleeping, membership >> established, start level:8 >> ****** >> >> Could someone, please, help me finding what I am doing wrong? >> >> Thanks, >> >> Théo C. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org >> For additional commands, e-mail: users-help@tomcat.apache.org >> >> Hello, Thank you for your answer. Indeed, I need both nodes in the Interceptor, but something else is wrong. I missed it the first time, but the official documentation mentions that the TcpFailureDetector must be above the StaticMembershipInterceptor. I suspect that it is also true of the other Interceptors, but I'm not sure. Here is my conf right now. I made some progress: I now have trafic between the two servers on the port 4110. Its regularity makes my think it's a heartbeat. However, the two Tomcat still do not share any sessions. [...] Is there some way for me to debug what is happening? To examine the cluster state? Thank you again, Théo C. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org