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 5CCB56D99 for ; Thu, 9 Jun 2011 13:16:00 +0000 (UTC) Received: (qmail 5056 invoked by uid 500); 9 Jun 2011 13:15:56 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 4898 invoked by uid 500); 9 Jun 2011 13:15:56 -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 4887 invoked by uid 99); 9 Jun 2011 13:15:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jun 2011 13:15:56 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rherrmann@eclipsesource.com designates 209.85.212.172 as permitted sender) Received: from [209.85.212.172] (HELO mail-px0-f172.google.com) (209.85.212.172) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jun 2011 13:15:51 +0000 Received: by pxi6 with SMTP id 6so828890pxi.3 for ; Thu, 09 Jun 2011 06:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eclipsesource.com; s=eclipsesource; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=ardAxFgeCTKMW4+bNhmUzXx/4+zOnzUCCtL21K7sqqQ=; b=V5QI+lNlfq+KcWYo64qAxTwwjYvZRlksU1gnB9R0wz0VKnMfOCwyIQCLjA6DaQrfyI NmD4DOXO6k/gj89T/Po/mlgoaiY0bS+a1JEf0o+/1O46D/zkuaBVHid9a25pQQk5rZpw as/BZQC34F7GvNW3bI/CKy/yxKgtGynusNCqk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=eclipsesource.com; s=eclipsesource; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=LUqh3oqLr24wHF8d9+ygvVWwEw+n85zPR9ywLRWOZZNqa+mknWCLOP1eG+PLqJB57H +VbxNY/CRvJd2XwqsMnTsf4lRsDhLqrgyfqcvjYwyhb4SzVygbLw0PgpXBg4ZJW+amRp DtrtMeS/SIWdwH0tCBMq+9dGl0q9RpBh63PSE= MIME-Version: 1.0 Received: by 10.68.17.195 with SMTP id q3mr272477pbd.369.1307625330929; Thu, 09 Jun 2011 06:15:30 -0700 (PDT) Received: by 10.68.54.228 with HTTP; Thu, 9 Jun 2011 06:15:26 -0700 (PDT) Date: Thu, 9 Jun 2011 15:15:26 +0200 Message-ID: Subject: How to cluster two embedded tomcat 7 instances From: =?ISO-8859-1?Q?R=FCdiger_Herrmann?= To: users@tomcat.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi all, I would like to programmatically set up two Tomcat engines and have them form a basic cluster - all in the same VM. Creating and starting the servlet engines already works Tomcat tomcat =3D new Tomcat() tomcat.setPort( 123 ); // create context, add servlet, ... tomcat.start(); What I am struggling with is setting up the cluster. My first attempt was to use the PersistentManager with Store that uses a shared directory. But it seems that it only persists session in time intervals. To enable failover, a session would need to be persisted after each request. However, I didn't find out how to configure or trigger the PersistentManager to do so. Still, the PersistenceManager setup was straightforward and if anyone knows how to form a cluster with this approach I would be grateful to know. I am aware of the SimpleTcpCluster, which I would try next. Just, before transforming the XML configuration into API calls (without known their meaning) I wanted to ask if there is an easier or even pre-built solution. Background: I work on enabling RAP [1], a web framework, to work in failover cluster environments. To ensure cluster-support, I have a set of JUnit tests that issue requests against an embeded cluster of servlet engines and then examine the state of sessions of the respective nodes, etc. Performance isn't important, neither is any advanced clustering feature (e.g. DeltaManager) needed. My focus is on finding a lightweight and purely programmatic solution. Thanks in advance, R=FCdiger [1] http://eclipse.org/rap --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org