Jetty has moved!
Jetty is a project at the Eclipse Foundation.
Homepage:http://www.eclipse.org/jetty
Downloads: http://download.eclipse.org/jetty/
Documentation:http://www.eclipse.org/jetty/documentation/current/
About:http://www.eclipse.org/jetty/about.php
Jetty Powered:http://www.eclipse.org/jetty/powered/
Contact the core Jetty developers at www.webtide.com
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Session Clustering with Terracotta

Build Instructions

  1. Before you start, make sure you have installed terracotta 2.4. We'll refer to the installation directory as $TC-HOME.
  2. If you haven't already got a boot jar for terracotta for your jvm version, then make one now. On linux this is $TC-HOME/bin/make-boot-jar.sh.
  3. Check out jetty from svn, or download an unzip a src bundle. We'll refer to the installation directory as $JETTY-HOME.
  4. Build it if it isn't already (mvn install).
  5. Go to the $JETTY_HOME/contrib/terracotta directory and build it with mvn install.
    Icon

    You'll need to have the terracotta tc.jar file installed in your local maven repository. If it isn't already, then maven will give you the exact instructions on what you need to do to put it there. It will look something like this:

  6. Copy the target/terracotta-sessions.jar you just built into $JETTY-HOME/lib/ext.

Configuration

Configuring Jetty to use Terracotta consists of creating a single TerracottaSessionIdManager per jetty instance to generate unqiue session ids, and setting up a special TerracottaSessionManager per webapp to be distributed.

The $JETTY-HOME/contrib/terracotta/src/main/resources/jetty.xml is an example file that you can use which sets up the TerracottaSessionIdManager. It is the standard jetty.xml, with these additional lines:

The workerName is a unqiue name for the jetty instance. In the example it is "fred" but you can use any naming scheme you'd like.

Now, we need to configure which webapps we want to be distributed. The easiest way to do that is to use the ContextDeployer, and create a context file to deploy each webapp. There are some examples for the sample webapps distributed with terracotta in $JETTY-HOME/contrib/terracotta/src/main/resources:

  • cart.xml
  • departmentTaskList.xml
  • townsend.xml

In each case, the important lines which establish the webapp with terracotta are:

Starting

.

  1. Start a terracotta server with a jetty configuration file. On linux this is $TC_HOME/bin/start-tc-server.sh -f $JETTY-HOME/jetty-6/contrib/terracotta/src/main/resources/tc-config-jetty.xml
  2. Set up the webapps that you want to use terracotta by following the instructions in the Configuration section above.
  3. Start jetty:
  • No labels
Contact the core Jetty developers at www.webtide.com
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery