1, 复制jetty-terracotta-sessions-6.1.25.jar到${JETTY_HOME}/lib/ext下
2,在jetty.xml中增加

Xml代码  
  1. <New id="tcIdManager" class="org.mortbay.terracotta.servlet.TerracottaSessionIdManager">  
  2.         <Arg>  
  3.             <Ref id="Server" />  
  4.         Arg>  
  5.         <Set name="workerName">  
  6.             <SystemProperty name="jetty.node" default="node1" />  
  7.         Set>  
  8.     New>  
  9.     <Call name="setAttribute">  
  10.         <Arg>tcIdManagerArg>  
  11.         <Arg>  
  12.             <Ref id="tcIdManager" />  
  13.         Arg>  
  14.     Call>  

3,在web.xml中增加一个过滤器


Xml代码  
  1. <filter>  
  2.       <filter-name>terracotta-filterfilter-name>  
  3.       <filter-class>org.terracotta.session.TerracottaJetty61xSessionFilterfilter-class>  
  4.       <init-param>  
  5.         <param-name>tcConfigUrlparam-name>  
  6.         <param-value>10.192.33.93:9510,10.192.33.94:9510,192.168.1.100:9510,192.168.1.101:9510param-value>  
  7.       init-param>  
  8.     filter>  
  9.     <filter-mapping>  
  10.       <filter-name>terracotta-filterfilter-name>  
  11.       <url-pattern>/*url-pattern>  
  12.       <dispatcher>ERRORdispatcher>  
  13.       <dispatcher>INCLUDEdispatcher>  
  14.       <dispatcher>FORWARDdispatcher>  
  15.       <dispatcher>REQUESTdispatcher>  
  16.     filter-mapping>  

4,在terracotta的tc-config.xml中增加


Xml代码  
  1. <clients>  
  2.     <modules>  
  3.         <module name="tim-jetty-6.1" version="2.2.0"/>  
  4.     modules>  
  5.     <logs>%(user.home)/terracotta/client-logslogs>  
  6.   clients>  


然后启动TCserver和jetty服务器即可