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 BBC724CC7 for ; Wed, 15 Jun 2011 22:54:18 +0000 (UTC) Received: (qmail 44286 invoked by uid 500); 15 Jun 2011 22:54:14 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 44159 invoked by uid 500); 15 Jun 2011 22:54:14 -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 44150 invoked by uid 99); 15 Jun 2011 22:54:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jun 2011 22:54:14 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [98.138.91.123] (HELO nm30-vm6.bullet.mail.ne1.yahoo.com) (98.138.91.123) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 15 Jun 2011 22:54:06 +0000 Received: from [98.138.90.52] by nm30.bullet.mail.ne1.yahoo.com with NNFMP; 15 Jun 2011 22:53:44 -0000 Received: from [98.138.87.2] by tm5.bullet.mail.ne1.yahoo.com with NNFMP; 15 Jun 2011 22:53:44 -0000 Received: from [127.0.0.1] by omp1002.mail.ne1.yahoo.com with NNFMP; 15 Jun 2011 22:53:44 -0000 X-Yahoo-Newman-Property: ymail-5 X-Yahoo-Newman-Id: 429644.35092.bm@omp1002.mail.ne1.yahoo.com Received: (qmail 43218 invoked by uid 60001); 15 Jun 2011 22:47:03 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1308178023; bh=+GKaSluGw8Pa7WL340MjMeGXFXPBrkBf4WQFmN5QaCE=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=2KjtD5DHAz5oDsia8H1H00NhdQeLI2qsjtZ5EfcxGkvoZncapeTvZvX5F5aWr7iiSvHLX3ErHELO60Ml3gTqquMZpmZQ5Jf+dS0qAGPP99X2gXM3dNgwsHN8AHVxXaTSYOgy72ZSsfVng1APOWa3fL5b6wdvhxrw8O0ug9UAhZM= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=I2mxoorZL+pXrBus0NmNtW4FYVDZ9fUIBppsfvG064X742CNXegeSs+nOf1+LkM1nqS9OxR9mEI0iclpJiiTNmM5i4SXQlI0GZdR2VmYf1y7wOg4RR2Ga0cEznB4JK9dDGqRC/sfAvFtsC6aU9xMSXJNU0Tn+pJQlTfjbHdAO8Y=; Message-ID: <901275.13613.qm@web125505.mail.ne1.yahoo.com> X-YMail-OSG: XN6a1HoVM1kfflHLfDB_SjzJ1Ie5ZkmdMfbaedYn7A3MmtD kdO.kTH.PJvKJWXSkRzBH2DrNdarO3_mZC8sPrcTe8DgK4.Oq63fzNcXcihp lfGPjBwa7CxQoYxZgwXZTU0tb_BGiIyLoCHZOWugN2OCF_5ECEdAnUYOuxNU iuqJao_9QZl87ayCz8g4w5ycJhWR80Guk92gkDTc8myg6h_O5nYZiLp.Wp8K OKCFtiQh62FTx_z21TSG7XxbfCj3a29zSQPtPHp4pwFkvsBcdvVgwOOzx7Fn C8CBWxmuPorPZLb9vdpy20VH1r.VNnnhh4w9vGUX6eGMSdOn8oePLfcbmAsE OQKLEw_Eu97.z5oLK.NjG5fRqDWcmpwJ2NPOspRz.KwjH8xgeOhWwMx5VJJn WwujUs6RxuoptOYLRG7S_.nUPomBTCQUxe3bBu.QDkINrx2qh.SFLQ4f6cqs TOTc.8S5VVx.Gxy20r94h47XFHHYB3j5YwXGZXDzc4rrzUpR3ozfnAvfsLV1 iDvXlwyAi_xQFPPOae7FUDanp22QLOkCrz1aicwQP6bYK5D9pzF.jS27dmGI 0MV3rAH_aYe9ZSchJaqaIv63FTezWaUyc1xbAd8TRJwCwXadEdgw3zb0AHLZ 3xSkSSxdyWPQhnIldxRZcRcnLfssE9ltUdTo6 Received: from [98.138.83.207] by web125505.mail.ne1.yahoo.com via HTTP; Wed, 15 Jun 2011 15:47:03 PDT X-Mailer: YahooMailWebService/0.8.111.304355 References: <652561.34068.qm@web125519.mail.ne1.yahoo.com> Date: Wed, 15 Jun 2011 15:47:03 -0700 (PDT) From: Mark Eggers Reply-To: Mark Eggers Subject: Re: Tomcat 6.0.18 clustering problem To: Tomcat Users List In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org ----- Original Message -----=0A=0A> From: Nilesh - MiKu =0A> To: Tomcat Users List ; Mark Eggers =0A> Cc: =0A> Sent: Tuesday, June 14, 2011 4:01 AM=0A> Sub= ject: Re: Tomcat 6.0.18 clustering problem=0A> =0A>T hanks Mark. :)=0A> =0A= > My comments inlined...=0A> =0A> Over and above, the underlined network pi= peline system also seems to be=0A> fine. Still dont understand what is wron= g. After enabling the logs to FINE=0A> level, i could see following...=0A> = =0A> Jun 14, 2011 10:26:38 AM org.apache.catalina.tribes.transport.Receiver= Base=0A> getBind=0A> FINE: Starting replication listener on address:xx.xx.x= x.xxx=0A> Jun 14, 2011 10:26:38 AM org.apache.catalina.tribes.transport.Rec= eiverBase=0A> bind=0A> INFO: Receiver Server Socket bound to:/xx.xx.xx.xxx:= 4000=0A> Jun 14, 2011 10:26:38 AM=0A> org.apache.catalina.tribes.membership= .McastServiceImpl setupSocket=0A> INFO: Setting cluster mcast soTimeout to = 500=0A> Jun 14, 2011 10:26:38 AM=0A> org.apache.catalina.tribes.membership.= McastServiceImpl waitForMembers=0A> INFO: Sleeping for 1000 milliseconds to= establish cluster membership, start=0A> level:4=0A> Jun 14, 2011 10:26:39 = AM=0A> org.apache.catalina.tribes.membership.McastServiceImpl waitForMember= s=0A> INFO: Done sleeping, membership established, start level:4=0A> Jun 14= , 2011 10:26:39 AM=0A> org.apache.catalina.tribes.membership.McastServiceIm= pl waitForMembers=0A> INFO: Sleeping for 1000 milliseconds to establish clu= ster membership, start=0A> level:8=0A> Jun 14, 2011 10:26:40 AM=0A> org.apa= che.catalina.tribes.membership.McastServiceImpl waitForMembers=0A> INFO: Do= ne sleeping, membership established, start level:8=0A> =0A> Since, the clus= ters do not recognize anything, no communication in the logs!=0A> :(=0A> = =0A> =0A> =0A> On Tue, Jun 14, 2011 at 5:07 AM, Mark Eggers =0A> wrote:=0A> =0A>> ----- Original Message -----=0A>> =0A>> > = From: Nilesh - MiKu =0A>> > To: users@tomcat.apache.= org=0A>> > Cc:=0A>> > Sent: Monday, June 13, 2011 8:36 AM=0A>> > Subject= : Tomcat 6.0.18 clustering problem=0A>> >=0A>> > Hi people...=0A>> >=0A>= > > Background :=0A>> >=0A>> > I have two nodes (say, n1 and n2) running= 3 instances of tomcat (say =0A> t1,=0A>> t2,=0A>> > t3), with n1 running= t1, t3 and n2 running t2. (All running same=0A>> > application.). I want = to make clustering for n1-t1 and n2-t2.=0A>> >=0A>> > Clustering cofig fo= r n1-t1 is....=0A>> >=0A>> > className=3D"org.apache.catali= na.ha.tcp.SimpleTcpCluster"=0A>> > channelSendOptions=3D"8">=0A>> >=0A>> = > className=3D"org.apache.catalina.ha.session.DeltaManager"= =0A>> > expireSessionsOnShutdown=3D"false"=0A>> > notifyListenersOnReplic= ation=3D"true"/>=0A>> >=0A>> > > > =0A> className=3D"org.apa= che.catalina.tribes.group.GroupChannel">=0A>> > > > =0A> c= lassName=3D"org.apache.catalina.tribes.membership.McastService"=0A>> > add= ress=3D"228.0.0.4"=0A>> > port=3D"45564"=0A>> > frequency=3D"500"=0A>> >= dropTime=3D"3000"/>=0A>> >=0A>> > > > =0A> className=3D"or= g.apache.catalina.tribes.transport.nio.NioReceiver"=0A>> > address=3D"auto= "=0A>> > port=3D"4000"=0A>> > autoBind=3D"100"=0A>> > selectorTimeout=3D= "5000"=0A>> > maxThreads=3D"6"/>=0A>> >=0A>> > > > =0A> clas= sName=3D"org.apache.catalina.tribes.transport.ReplicationTransmitter">=0A>>= > > >=0A>> =0A> className=3D"org.apache.catalina.tribes.tr= ansport.nio.PooledParallelSender"/>=0A>> > =0A>> >=0A>> > > >=0A>> =0A> className=3D"org.apache.catalina.tribes.group.int= erceptors.TcpPingInterceptor"/>=0A>> > > >=0A>> =0A> clas= sName=3D"org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/= >=0A>> > > >=0A>> =0A> className=3D"org.apache.catalina.t= ribes.group.interceptors.MessageDispatch15Interceptor"/>=0A>> > = =0A>> >=0A>> > className=3D"org.apache.catalina.ha.tcp.Replic= ationValve"=0A>> > =0A> filter=3D".*\.ico;.*\.gif;.*\.js;.*\.jpg;.*\.png;.= *\.css;.*\.txt;"/>=0A>> >=0A>> > > > =0A> className= =3D"org.apache.catalina.ha.session.ClusterSessionListener"/>=0A>> >=0A>> = > =0A>> >=0A>> > Clustering cofig for n2-t2 is same as above...= .=0A>> >=0A>> > n1-t3 has element commented and is not particip= ating =0A> in=0A>> > clustering=0A>> > at all. Its being used for some ot= her special purpose.=0A>> >=0A>> > Here is what i get when i start the to= mcat instance.=0A>> >=0A>> > Jun 11, 2011 9:26:18 AM org.apache.catalina.= core.AprLifecycleListener=0A>> init=0A>> > INFO: The APR based Apache Tom= cat Native library which allows optimal=0A>> > performance in production e= nvironments was not found on the=0A>> > java.library.path: /usr/lib/jvm/ja= v=0A>> >=0A>> =0A> a-1.6.0-sun-1.6.0.13/jre/lib/amd64/server:/usr/lib/jvm/= java-1.6.0-sun-1.6.0.13/jre/lib/amd64:/usr/lib/jvm/java-1.6.0-sun-1.6.0.13/= jre/../lib/amd64:/usr/java/packages=0A>> > /lib/amd64:/lib:/usr/lib=0A>> = > Jun 11, 2011 9:26:18 AM org.apache.coyote.http11.Http11Protocol init=0A>>= > INFO: Initializing Coyote HTTP/1.1 on http-8080=0A>> > Jun 11, 2011 9:= 26:18 AM org.apache.catalina.startup.Catalina load=0A>> > INFO: Initializa= tion processed in 446 ms=0A>> > Jun 11, 2011 9:26:18 AM org.apache.catalin= a.core.StandardService start=0A>> > INFO: Starting service Catalina=0A>> = > Jun 11, 2011 9:26:18 AM org.apache.catalina.core.StandardEngine start=0A>= > > INFO: Starting Servlet Engine: Apache Tomcat/6.0.18=0A>> > Jun 11, 20= 11 9:26:18 AM org.apache.catalina.ha.tcp.SimpleTcpCluster =0A> start=0A>> = > INFO: Cluster is about to start=0A>> > Jun 11, 2011 9:26:18 AM =0A> org.= apache.catalina.tribes.transport.ReceiverBase=0A>> > bind=0A>> > INFO: Re= ceiver Server Socket bound to:/70.87.28.134:4000=0A>> > Jun 11, 2011 9:26:= 18 AM=0A>> > org.apache.catalina.tribes.membership.McastServiceImpl setupS= ocket=0A>> > INFO: Setting cluster mcast soTimeout to 500=0A>> > Jun 11, = 2011 9:26:18 AM=0A>> > org.apache.catalina.tribes.membership.McastServiceI= mpl waitForMembers=0A>> > INFO: Sleeping for 1000 milliseconds to establis= h cluster membership,=0A>> start=0A>> > level:4=0A>> > Jun 11, 2011 9:26= :19 AM=0A>> > org.apache.catalina.tribes.membership.McastServiceImpl waitF= orMembers=0A>> > INFO: Done sleeping, membership established, start level:= 4=0A>> > Jun 11, 2011 9:26:19 AM=0A>> > org.apache.catalina.tribes.member= ship.McastServiceImpl waitForMembers=0A>> > INFO: Sleeping for 1000 millis= econds to establish cluster membership,=0A>> start=0A>> > level:8=0A>> >= Jun 11, 2011 9:26:20 AM=0A>> > org.apache.catalina.tribes.membership.Mcas= tServiceImpl waitForMembers=0A>> > INFO: Done sleeping, membership establi= shed, start level:8=0A>> > Jun 11, 2011 9:26:20 AM org.apache.catalina.loa= der.WebappClassLoader=0A>> > validateJarFile=0A>> > INFO: validateJarFile= (/opt/=0A>> > =0A> mail.pw/webapps/pw-mail/WEB-INF/lib/selenium-server-0.9= .2-standalone.jar)=0A>> -=0A>> > jar not loaded. See Servlet Spec 2.3, se= ction 9.7.2. Offending=0A>> > class: javax/servlet/Servlet.class=0A>> > J= un 11, 2011 9:26:20 AM org.apache.catalina.loader.WebappClassLoader=0A>> >= validateJarFile=0A>> > INFO: validateJarFile(/opt/=0A>> > mail.pw/webapp= s/pw-mail/WEB-INF/lib/servlet-api-2.5-6.1.11.jar) - jar=0A>> not=0A>> > l= oaded. See Servlet Spec 2.3, section 9.7.2. Offending class: ja=0A>> > vax= /servlet/Servlet.class=0A>> > Jun 11, 2011 9:26:21 AM org.apache.catalina.= ha.session.DeltaManager =0A> start=0A>> > INFO: Register manager /pw-mail = to cluster element Engine with name=0A>> Catalina=0A>> > Jun 11, 2011 9:2= 6:21 AM org.apache.catalina.ha.session.DeltaManager =0A> start=0A>> > INFO= : Starting clustering manager at /pw-mail=0A>> > Jun 11, 2011 9:26:21 AM o= rg.apache.catalina.ha.session.DeltaManager=0A>> > getAllClusterSessions=0A= >> > INFO: Manager [localhost#/pw-mail]: skipping state transfer. No =0A> = members=0A>> > active in cluster group.=0A>> > Jun 11, 2011 9:26:28 AM or= g.apache.catalina.ha.session.DeltaManager =0A> start=0A>> > INFO: Register= manager /manager to cluster element Engine with name=0A>> Catalina=0A>> = > Jun 11, 2011 9:26:28 AM org.apache.catalina.ha.session.DeltaManager =0A> = start=0A>> > INFO: Starting clustering manager at /manager=0A>> > Jun 11,= 2011 9:26:28 AM org.apache.catalina.ha.session.DeltaManager=0A>> > getAll= ClusterSessions=0A>> > INFO: Manager [localhost#/manager]: skipping state = transfer. No =0A> members=0A>> > active in cluster group.=0A>> > Jun 11, = 2011 9:26:28 AM org.apache.coyote.http11.Http11Protocol start=0A>> > INFO:= Starting Coyote HTTP/1.1 on http-8080=0A>> > Jun 11, 2011 9:26:28 AM org.= apache.jk.common.ChannelSocket init=0A>> > INFO: JK: ajp13 listening on /0= .0.0.0:8009=0A>> > Jun 11, 2011 9:26:28 AM org.apache.jk.server.JkMain sta= rt=0A>> > INFO: Jk running ID=3D0 time=3D0/24=A0 config=3Dnull=0A>> > Jun= 11, 2011 9:26:28 AM org.apache.catalina.startup.Catalina start=0A>> > INF= O: Server startup in 10245 ms=0A>> >=0A>> > Note : context for all instan= ces is pw-mail.=0A>> >=0A>> > Can anyone say what is wrong with this conf= iguration.=0A>> >=0A>> >=0A>> > --=0A>> > Best Regards,=0A>> > Nilesh = Mevada=0A>> >=0A>> =0A>> This looks like an AMD 64 bit Linux platform? I'= m just guessing based =0A> on=0A>> the paths in your mail message.=0A>> = =0A>> yes.=0A> =0A>> At any rate, I'll make some comments which will hope= fully help.=0A>> =0A>> First of all, I would recommend upgrading to the la= test Tomcat 6 version=0A>> (6.0.32) and JRE version if possible. There hav= e been a lot of=0A>> cluster-related patches since 6.0.18. If possible, lo= ok at upgrading to the=0A>> latest Tomcat 7 version (7.0.14).=0A>> =0A>> = >From the output, it looks like you have the Selenium server included in=0A>= > your application. I think the server version includes an embedded Jetty= =0A>> server, and Tomcat is complaining about classes that are included.= =0A>> =0A>> See:=0A>> =0A>> > INFO: validateJarFile(/opt/=0A>> > =0A> ma= il.pw/webapps/pw-mail/WEB-INF/lib/selenium-server-0.9.2-standalone.jar)=0A>= > -=0A>> > jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending= =0A>> > class: javax/servlet/Servlet.class=0A>> =0A>> =0A>> I think you'l= l need the corresponding coreless version, but check the=0A>> Selenium doc= umentation to make sure.=0A>> =0A>> Also, you've included the servlet API = in your application. This is =0A> shown=0A>> by:=0A>> =0A>> > INFO: valid= ateJarFile(/opt/=0A>> > mail.pw/webapps/pw-mail/WEB-INF/lib/servlet-api-2.= 5-6.1.11.jar) - jar=0A>> not=0A>> > loaded. See Servlet Spec 2.3, section= 9.7.2. Offending class: ja=0A>> > vax/servlet/Servlet.class=0A>> =0A>> = =0A>> Don't do this. Your IDE should enable you to write servlet code with= out =0A> it=0A>> packaging up the API. Each IDE is different, so read your= documentation.=0A>> =0A>> will take care of the above two.=0A> =0A> =0A>>= Make sure that your application is marked distributable by adding=0A>> <= distributable/> in your web.xml file. Make sure that all session =0A> prope= rties=0A>> implement Serializable.=0A>> =0A>> yes, its marked that way.= =0A> =0A> =0A>> Your cluster configuration doesn't look too much different= than one I =0A> use.=0A>> =0A>> > className=3D"org.apache.c= atalina.ha.tcp.SimpleTcpCluster"=0A>> > channelSendOptions=3D"8">=0A>> =0A= >> I'm not sure why you are using ASYNCHRONOUS as your channelSendOptions= =0A>> (especially without an ACK). This will allow session updates to be = =0A> processed=0A>> in a different order from which they were sent. I don'= t know how this =0A> will=0A>> impact your application.=0A>> =0A>> Just t= o make response faster. Although, the app is not so heavily used, and=0A> i= can make the value 4 i.e. Sync with Ack.=0A> =0A> =0A>> > > >=0A>> =0A> className=3D"org.apache.catalina.tribes.group.interceptors.= TcpPingInterceptor"/>=0A>> =0A>> You're using an interceptor that doesn't = seem to be documented. =0A> Looking at=0A>> the source code, it appears th= at this interceptor sends a ping message out=0A>> every second.=0A>> =0A>>= > className=3D"org.apache.catalina.ha.tcp.ReplicationValve"= =0A>> > =0A> filter=3D".*\.ico;.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.css;.*\.= txt;"/>=0A>> =0A>> You've removed the htm and html items from the filter, = and added ico. =0A> I'll=0A>> assume that there are no htm / html files in= your application (all pages =0A> are=0A>> generated dynamically).=0A>> = =0A>> yes. There a couple of html files, but since i am using nginx, that = static=0A> html file request never reaches my tomcat instance. Hence no wor= ries.=0A> =0A> =0A>> In short, I don't see any show stoppers in your confi= guration, but =0A> maybe=0A>> other list members have some ideas.=0A>> =0A= >> However, there could be some system issues that are preventing multicas= ting=0A>> from working.=0A>> =0A>> 1. Make sure your system is set up for= multicasting=0A>> =0A>> Check to see if your interface is enabled for mul= ticasting. Mine looks like=0A>> this in part:=0A>> =0A>> eth0=A0 =A0 =A0 = Link encap:Ethernet=0A>> =A0 =A0 =A0 =A0 =A0 UP BROADCAST RUNNING MULTICAS= T=A0 MTU:1500=A0 Metric:1=0A>> =0A>> I have MASTER - SLAVE multicast setti= ngs... something like..=0A> bond0=A0 =A0 Link encap:Ethernet=0A> UP BROADC= AST RUNNING MASTER MULTICAST=A0 MTU:1500=A0 Metric:1=0A> bond0:0=A0 Link e= ncap:Ethernet=0A> UP BROADCAST RUNNING MASTER MULTICAST=A0 MTU:1500=A0 Metr= ic:1=0A> eth0=A0 =A0 =A0 Link encap:Ethernet=0A> UP BROADCAST RUNNING SLAVE= MULTICAST=A0 MTU:1500=A0 Metric:1=0A> =0A> Anyway, the things are proper a= s far as this thing is concerned.=0A> =0A> 2. Make sure your firewall allow= s multicasting. By default, Fedora 15 does=0A>> not. Other Linux distribut= ions may be different. Add the following to your=0A>> firewall rules (adju= st for your distribution).=0A>> =0A>> -A INPUT -d 224.0.0.0/4 -m state --s= tate NEW -j ACCEPT=0A>> =0A>> You'll probably want this to be much more re= strictive, but this may get =0A> you=0A>> up and running.=0A>> =0A>> 3. A= dd a multicast route=0A>> =0A>> Adjust this to fit your distribution and c= onfiguration.=0A>> =0A>> /sbin/ip route add to multicast 224.0.0.0/4 dev e= th0=0A>> =0A>> Filip Hanik published a link to a multicast test tool (MCas= ter) that was=0A>> included in (a now ancient version of) Tomcat 4. This w= as useful in order =0A> to=0A>> confirm that you had multicasting set up c= orrectly on your systems. You=0A>> might be able to dig it up and build it= by following the Archives link on=0A>> the Tomcat home page.=0A>> =0A>> = =0A>> Seems to be correct on my host for the above two points..=0A> =0A> = =0A>> 4. Don't announce multicast on the localhost address.=0A>> =0A>> By= default, Tomcat gets the host address for multicasting via=0A>> java.net.= InetAddress.getLocalHost().getHostAddress(). Make sure you're =0A> not=0A>>= advertising 127.0.0.1. In Linux, the most common source of this problem i= s=0A>> by adding your host name to the localhost line in /etc/hosts.=0A>> = =0A> =0A> Thanks for your separate log config. i could set it up, and see t= hat n1-t1=0A> and n2-t2 are binding to appropriate n2, n1 ip addresses well= .=0A> =0A>> =0A> =0A> You can also set up separate logging for clustering b= y making some changes=0A>> to $CATALINA_HOME/conf/logging.properties=0A>> = =0A>> For example:=0A>> =0A>> # Added a cluster logging handler=0A>> han= dlers =3D 1catalina.org.apache.juli.FileHandler,=0A>> 2localhost.org.apach= e.juli.FileHandler,=0A>> 3manager.org.apache.juli.FileHandler,=0A>> 4host= -manager.org.apache.juli.FileHandler,=0A>> java.util.logging.ConsoleHandle= r,5cluster.org.apache.juli.FileHandler=0A>> =0A>> # specify the level and = where to store the information=0A>> 5cluster.org.apache.juli.FileHandler.l= evel =3D FINER=0A>> 5cluster.org.apache.juli.FileHandler.directory =3D ${c= atalina.base}/logs=0A>> 5cluster.org.apache.juli.FileHandler.prefix =3D cl= uster.=0A>> =0A>> # various cluster components logging=0A>> org.apache.ca= talina.tribes.MESSAGES.level =3D FINE=0A>> org.apache.catalina.tribes.MESS= AGES.handlers =3D=0A>> 5cluster.org.apache.juli.FileHandler=0A>> =0A>> or= g.apache.catalina.tribes.level =3D FINE=0A>> org.apache.catalina.tribes.ha= ndlers =3D 5cluster.org.apache.juli.FileHandler=0A>> =0A>> org.apache.cata= lina.ha.level =3D FINE=0A>> org.apache.catalina.ha.handlers =3D 5cluster.o= rg.apache.juli.FileHander=0A>> =0A>> org.apache.catalina.ha.deploy.level = =3D INFO=0A>> org.apache.catalina.ha.deploy.handlers =3D=0A>> 5cluster.or= g.apache.juli.FileHandler=0A>> =0A>> Adjust the logging levels accordingly= .=0A>> =0A>> . . . . just my two cents.=0A>> =0A>> /mde/=0A=0A=0ANo need = to cc me, since I read the list. All that does is give me duplicate mail me= ssages in my inbox :-p.=0A=0A> Jun 14, 2011 10:26:38 AM org.apache.catalina= .tribes.transport.ReceiverBase=0A> getBind=0A> FINE: Starting replication l= istener on address:xx.xx.xx.xxx=0A> Jun 14, 2011 10:26:38 AM org.apache.cat= alina.tribes.transport.ReceiverBase=0A> bind=0A> INFO: Receiver Server Sock= et bound to:/xx.xx.xx.xxx:4000=0A> Jun 14, 2011 10:26:38 AM=0A> org.apache.= catalina.tribes.membership.McastServiceImpl setupSocket=0A> INFO: Setting c= luster mcast soTimeout to 500=0A> Jun 14, 2011 10:26:38 AM=0A> org.apache.c= atalina.tribes.membership.McastServiceImpl waitForMembers=0A> INFO: Sleepin= g for 1000 milliseconds to establish cluster membership, start=0A> level:4= =0A> Jun 14, 2011 10:26:39 AM=0A> org.apache.catalina.tribes.membership.Mca= stServiceImpl waitForMembers=0A> INFO: Done sleeping, membership establishe= d, start level:4=0A> Jun 14, 2011 10:26:39 AM=0A> org.apache.catalina.tribe= s.membership.McastServiceImpl waitForMembers=0A> INFO: Sleeping for 1000 mi= lliseconds to establish cluster membership, start=0A> level:8=0A> Jun 14, 2= 011 10:26:40 AM=0A> org.apache.catalina.tribes.membership.McastServiceImpl = waitForMembers=0A> INFO: Done sleeping, membership established, start level= :8=0A>=A0=0A=0A=0AThat's all you see? Hmm.=0A=0AOK, first of all, I'm tryin= g to emulate this on a single machine. I've played with aliased IP addresse= s, but no matter how I configure things, communication still goes across lo= calhost.=0A=0AMy current environment:=0A=0AOS: =A0 =A0 Fedora 15=A02.6.38.7= -30.fc15.i686 #1 SMP=0AJRE: =A0 =A01.6.0_22-b04 (with the=A0vulnerability p= atch applied)=0ATomcat: 6.0.29 (but see notes below)=0A=0AHacking things up= to represent multiple hosts is an amusing exercise. Here's the best I've b= een able to accomplish.=0A=0AFirst, set up IP address aliases.=0A=0AAs root= , I do this.=0A=0A/sbin/ifconfig eth0:0 192.168.0.253 netmask 255.255.255.0= up=0A/sbin/ifconfig eth0:1 192.168.0.252 netmask 255.255.255.0 up=0A/sbin/= ifconfig eth0:2 192.168.0.251 netmask 255.255.255.0 up=0A=0AFor convenience= , I add host names to /etc/hosts.=0A=0A192.168.0.253phobos=0A192.168.0.252d= eimos=0A192.168.0.251mars=0A=0AThe fun part is modifying $CATALINA_BASE/con= f/server.xml. I use multiple $CATALINA_BASE and a single $CATALINA_HOME to = simplify the setup.=0A=0AIn each server.xml, I did the following:=0A=0A1. C= hange the shutdown port to be unique for each Tomcat instance.=0A=0AIn Tomc= at 6.0.x, the shutdown port is bound to all interfaces. In Tomcat 7.0.x, yo= u can specify which interface.=0A=0A2. Specify unique ports in the Receiver= element of Cluster->Channel for each Tomcat instance.=0A=0A3. Add an addre= ss attribute to the following elements for each Tomcat instance=0A=0AAll Co= nnector elements (I use an AJP and HTTP connector).=0AReceiver element in C= luster->Channel=0ATransport element in Cluster->Channel->Sender=0A=0AThis d= oesn't take care of the multicasting announcements, and in Linux you cannot= bind that to a particular address.=0A=0AWhen I start up my cluster, I see = the following in the logs (from one host).=0A=0AFINE: Mcast add member org.= apache.catalina.tribes.membership.MemberImpl[tcp://{192, 168, 0, 251}:4100,= {192, 168, 0, 251},4100, alive=3D1011,id=3D{20 84 -32 54 -117 4 65 -60 -98 = 104 93 -50 80 -110 3 -93 }, payload=3D{}, command=3D{}, domain=3D{}, ]=0A= =0A=0AFINE: Mcast add member org.apache.catalina.tribes.membership.MemberIm= pl[tcp://{192, 168, 0, 253}:4200,{192, 168, 0, 253},4200, alive=3D6525,id= =3D{41 43 -84 33 -73 126 69 -120 -109 -5 40 -23 -101 -21 21 -77 }, payload= =3D{}, command=3D{}, domain=3D{}, ]=0A=0A=0A=0AI have a small test applicat= ion that uses sessions. A user authenticates against a MySQL database, popu= lates some attributes, and then chooses a randomly generated pet.=0A=0AWhen= I watch the lo adapter with Wireshark, I see messages going across TCP por= ts 4000, 4100, and 4200. This corresponds to the Cluster->Membership->Recei= ver port number attribute I've specified in server.xml.=0A=0ALooking more c= losely at those packets, they seem to contain the actual serialized session= information (among other things).=0A=0ABased on that, I think you'll have = to add something like the following in /etc/sysconfig/iptables:=0A=0A-A INP= UT -m state --state NEW -m tcp -p tcp --dport 4000 -s 192.168.0.0/24 -j ACC= EPT=0A-A INPUT -m state --state NEW -m tcp -p tcp --dport 4100 -s 192.168.0= .0/24 -j ACCEPT=0A-A INPUT -m state --state NEW -m tcp -p tcp --dport 4200 = -s 192.168.0.0/24 -j ACCEPT=0A=0AIn short, replace the dport with the other= cluster members' ports. Of course, adjust port numbers and source addresse= s appropriately.=0A=0AI've come across other information via a Google searc= h that indicates you might have to add the following two lines to your ipta= bles configuration.=0A=0A-A INPUT -m state --state NEW -m tcp -p tcp --dpor= t 45564 -s 192.168.0.0/24 -j ACCEPT=0A-A INPUT -m state --state NEW -m udp = -p udp --dport 45564 -s 192.168.0.0/24 -j ACCEPT=0A=0AThis corresponds to t= he port attribute in Cluster->Channel->Membership.=0A=0AHowever, looking at= some Wireshark traces, I only see this port being used with UDP / Multicas= t.=0A=0AAs for the Ping Interceptor:=0A=0A=0AEvery time= I tried using that, I got a NullPointer exception (even with the firewall = turned off). My cluster configuration (using different ports, and no IP ali= ases):=0A=0A=0A=0A=A0 =0A=A0 =0A=A0 =A0 =0A=A0 =A0 =0A=A0 =A0 =0A=A0 =A0 =A0 =0A=A0 =A0 =0A= =A0 =A0 =0A=A0 =A0 =0A=A0 =A0 =0A=A0 =A0 =0A=A0 =0A=A0 =0A=A0 =0A=A0 =0A=0A=0AIn Tomcat 6.0.29:=0A=0A=0AWARNING: Unable to sen= d ping from TCP ping thread.=0Ajava.lang.NullPointerException=0A=A0 =A0 =A0= =A0 at org.apache.catalina.tribes.group.interceptors.TcpPingInterceptor.se= ndPing(TcpPingInterceptor.java:121)=0Aat org.apache.catalina.tribes.group.i= nterceptors.TcpPingInterceptor$PingThread.run(TcpPingInterceptor.java:166)= =0AJun 15, 2011 3:27:40 PM org.apache.catalina.tribes.group.interceptors.Tc= pPingInterceptor$PingThread run=0AWARNING: Unable to send ping from TCP pin= g thread.=0Ajava.lang.NullPointerException=0Aat org.apache.catalina.tribes.= group.interceptors.TcpPingInterceptor.sendPing(TcpPingInterceptor.java:121)= =0Aat org.apache.catalina.tribes.group.interceptors.TcpPingInterceptor$Ping= Thread.run(TcpPingInterceptor.java:166)=0A=0AAlso, this pops up as well:=0A= =0AJun 15, 2011 3:27:41 PM org.apache.catalina.tribes.group.GroupChannel$He= artbeatThread run=0ASEVERE: Unable to send heartbeat through Tribes interce= ptor stack. Will try to sleep again.=0Ajava.lang.NullPointerException=0Aat = org.apache.catalina.tribes.group.interceptors.TcpPingInterceptor.sendPing(T= cpPingInterceptor.java:121)=0Aat org.apache.catalina.tribes.group.intercept= ors.TcpPingInterceptor.heartbeat(TcpPingInterceptor.java:93)=0Aat org.apach= e.catalina.tribes.group.ChannelInterceptorBase.heartbeat(ChannelInterceptor= Base.java:97)=0Aat org.apache.catalina.tribes.group.ChannelInterceptorBase.= heartbeat(ChannelInterceptorBase.java:97)=0Aat org.apache.catalina.tribes.g= roup.ChannelInterceptorBase.heartbeat(ChannelInterceptorBase.java:97)=0Aat = org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.heartbeat(= TcpFailureDetector.java:192)=0Aat org.apache.catalina.tribes.group.ChannelI= nterceptorBase.heartbeat(ChannelInterceptorBase.java:97)=0Aat org.apache.ca= talina.tribes.group.GroupChannel.heartbeat(GroupChannel.java:149)=0Aat org.= apache.catalina.tribes.group.GroupChannel$HeartbeatThread.run(GroupChannel.= java:661)=0A=0AWithout the TcpPing interceptor, I get no NullPointer error = messages.=0A=0AI apologize for the length and log snippet formatting. I hop= e someone finds this useful.=0A=0AI'll try the TcpPing interceptor with the= 6.0.x trunk later on today and see if I still get the NullPointer messages= .=0A=0A. . . . just my two cents.=0A=0A/mde/=A0 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org