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 10 Next »

Clustering with Jetty and WADI

What is WADI?

WADI is an acronym of 'WADI Application Distribution Infrastructure'. WADI started life as a solution to the problems surrounding the distribution of state in clustered web tiers, but is becoming a more generalised distributed space service.

How to cluster your web application with Jetty and WADI

First, svn checkout jetty and then buid it by calling mvn install. Once it finishes, go to jetty.home/extras/wadi and mvn install that project. Besides compiling the java files and generating the jetty-wadi-session-manager jar file, this will copy all the dependencies into jetty.home/lib/wadi.

To cluster a webapp, you need to define the WadiSessionManager and create an instance of WadiSessionHandler (passing the WadiSessionManager object as a constructor parameter). Then set the WadiSessionHandler as your webapp's SessionHandler. You can do this in a context xml config file.

This context xml config file is readily usable. After building the jetty.home/extras/wadi project, drop this config file into the jetty.home/contexts directory.  You can create a node in the cluster by calling "java -Dnode.name=nodename -Djetty.port=portnumber Djava.net.preferIPv4Stack=true -jar start.jar etc/jetty.xml" in the jetty home directory (where nodename=a distinct node name for this node, and portnumber=a distinct port number for this node).

For instance, if you want to create a cluster with three nodes, you can do so by calling the following: 

java -Djetty.port=7070 -Dnode.name=orange -Djava.net.preferIPv4Stack=true -jar start.jar etc/jetty-wadi-cluster.xml

java -Djetty.port=8080 -Dnode.name=red -Djava.net.preferIPv4Stack=true -jar start.jar etc/jetty-wadi-cluster.xml

java -Djetty.port=9090 -Dnode.name=blue -Djava.net.preferIPv4Stack=true -jar start.jar etc/jetty-wadi-cluster.xml 

  • 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