群集配置在样品server.xml 文件里有描述。需要指出的是以mcastXXX开头的是关于会员成分multicast ping的属性,以tcpXXX开头的是关于TCP replication的属性。
会员成分是通过在相同的multicast IP 和 port上的所有tomcat实例建立的。TCP listen port是从其他会员那里来的会话复制在这它里被接收到的端口。
复制阀被用来发现请求什么时候被完成,并启动复制。
One of the most important performance considerations is the synchronous (pooled or not pooled) versus asynchronous replication mode. In a synchronous replication mode the request doesn't return until the replicated session has been sent over the wire and reinstantiated on all the other cluster nodes. There are two settings for synchronous replication. Pooled or not pooled. Not pooled (ie replicationMode="fastasnycqueue" or "synchronous") means that all the replication request are sent over a single socket. Using synchronous mode can potentially becomes a bottleneck when a lot of messages generated, You can overcome this bottleneck by setting replicationMode="pooled" but then you worker threads blocks with replication . What is recommended here is to increase the number of threads that handle incoming replication request. This is the tcpThreadCount property in the cluster section of server.xml. The pooled setting means that we are using multiple sockets, hence increases the performance. Asynchronous replication, should be used if you have sticky sessions until fail over, then your replicated data is not time crucial, but the request time is, at this time leave the tcpThreadCount to be number-of-nodes-1. During async replication, the request is returned before the data has been replicated. async replication yields shorter request times, and synchronous replication guarantees the session to be replicated before the request returns.
The parameter "replicationMode" has four different settings: "pooled", "synchronous", "asynchronous" and "fastasyncqueue"
Bind session after crash to failover node |
As you configure more then two nodes at same cluster for backup, most loadbalancer send don't all your requests after failover to the same node.
The JvmRouteBinderValve handle tomcat jvmRoute takeover using mod_jk module after node failure. After a node crashed the next request going to other cluster node. The JvmRouteBinderValve now detect the takeover and rewrite the jsessionid information to the backup cluster node. After the next response all client request goes direct to the backup node. The change sessionid send also to all other cluster nodes. Well, now the session stickyness work directly to the backup node, but traffic don't go back too restarted cluster nodes! As jsessionid was created by cookie, the change JSESSIONID cookie resend with next response.
You must add JvmRouteBinderValve and the corresponding cluster message listener JvmRouteSessionIDBinderListener. As you add the new listener you must also add the default ClusterSessionListener that receiver the normal cluster messages.
|
|
|
|
<Cluster className="org.apache.catalina.tcp.SimpleTcpCluster" >
...
<Valve className="org.apache.catalina.cluster.session.JvmRouteBinderValve"
enabled="true" sessionIdAttribute="takeoverSessionid"/>
<ClusterListener className="org.apache.catalina.cluster.session.JvmRouteSessionIDBinderListener" />
<ClusterListener className="org.apache.catalina.cluster.session.ClusterSessionListener" />
...
<Cluster>
|
|
|
|
|
Hint: With attribute sessionIdAttribute you can change the request attribute name that included the old session id. Default attribuite name is org.apache.catalina.cluster.session.JvmRouteOrignalSessionID.
Trick: You can enable this mod_jk turnover mode via JMX before you drop a node to all backup nodes! Set enable true on all JvmRouteBinderValve backups, disable worker at mod_jk and then drop node and restart it! Then enable mod_jk Worker and disable JvmRouteBinderValves again. This use case means that only requested session are migrated.
|
|
相关推荐
部署Servlet需要的apache-tomcat-5.5.20.7z
tomcat5.5 一个是HTTP WEB服务器,另一个是servlet容器(servlet container),最新的5.5.X系列实现Servlet 2.4/JSP 2.0Spec。在我们生产的环境中,往往需要Apache做前端服务器,Tomcat做后端服务器。此时我们就需要...
由于有了Sun 的参与和支持,最新的Servlet 和JSP 规范总是能在Tomcat 中得到体现,Tomcat 5 支持最新的Servlet 2.4 和JSP 2.0 规范。因为Tomcat 技术先进、性能稳定,而且免费,因而深受Java 爱好者的喜爱并得到了...
由于有了Sun 的参与和支持,最新的Servlet 和JSP 规范总是能在Tomcat 中得到体现,Tomcat 5 支持最新的Servlet 2.4 和JSP 2.0 规范。因为Tomcat 技术先进、性能稳定,而且免费,因而深受Java 爱好者的喜爱并得到了...
的Apache Tomcat 5.5.X支持相同的Servlet和JSP规范版本的的Apache Tomcat 5.0.x中 还有在许多领域显著变化引擎盖下,从而提高了性能,稳定性和总拥有成本。有关详细信息,请参阅Apache Tomcat 5.5 Changelog。 的...
由于有了Sun 的参与和支持,最新的Servlet 和JSP 规范总是能在Tomcat 中得到体现,Tomcat 5 支持最新的Servlet 2.4 和JSP 2.0 规范。因为Tomcat 技术先进、性能稳定,而且免费,因而深受Java 爱好者的喜爱并得到了...
由于有了Sun 的参与和支持,最新的Servlet 和JSP 规范总是能在Tomcat 中得到体现,Tomcat 5支持最新的Servlet 2.4 和JSP 2.0 规范。因为Tomcat 技术先进、性能稳定,而且免费,因而深受Java 爱好者的喜爱并得到了...
另外,Tomcat和IIS、Apache等Web服务器一样,具有处理HTML页面的功能,另外它还是一个Servlet和JSP容器,独立的Servlet容器是Tomcat的默认模式。不过,Tomcat处理静态HTML的能力不如Apache服务器。
利用tomcat 5.5解决:项目中jsp-api.jar和servlet-api.jar与tomcat6(或tomcat7)中jsp-api.jar和servlet-api.jar的冲突
apache_tomcat_6_windows_x64 Apache Tomcat 6.x 在汲取 Tomcat 5.5.x优点的基础上,实现了Servlet 2.5和JSP 2.1等特性的支持。除此以外的改进列表如下: · 内存使用优化 · 更大的IO容量 · 重构聚类
Tomcat 是一个轻量级应用服务器,在中小型系统和并发访问... 在汲取 Tomcat 5.5.x优点的基础上,实现了Servlet 2.5和JSP 2.1等特性的支持。除此以外的改进列表如下: · 内存使用优化 · 更大的IO容量 · 重构聚类
tomcat5.5安装版是一款开源的轻量级应用服务器,该服务器严格采用了servlet和JSP规范,比起绝大多数的商业软件而言,该软件更加实用,具有占用系统资源小、简单易上手、兼容性强等优势,如果你是一名开发人员的话,...
2.4 配置apachetomcat 2.5 配置macromediajrun 2.6 配置cauchoresin 2.7 建立开发环境 2.8 测试系统的设置 2.9 实现简化的部署方法 2.10 默认web应用的部署目录:汇总 2.11 web应用:预览 第3章 ...
TomCat8.09 [Servlet/JSP服务器] fastcgi5.5.11 [CGI / FastCGI/PHP解释器] mysql 5.5.90 [小型关系型数据库] FileZilla_server [小巧的FTP服务器软件] eAccelerator [PHP脚本加速引擎] ZendOptimizer5.6 [PHP...
5.5 如何将一个普通的JSP文件转换为一个XML 文档 5.6 JSP1.1的DTD文件 第6章 JSP基础实例 6.1 第一个JSP程序—HelloWorld! 6.2 注释的使用 6.3 脚本元素 6.3.1 声明 6.3.2 表达式 6.3.3 脚本代码 6.4 page...
中文参考手册,spring3.1_帮助文档_英文,Struts 1.3.8 API,Struts 2 Core 2.0.6 API ,StrutsAPI 1.2.7,Tomcat5.5_Servlet_Jsp_API文档,Validator,VBScript_使用手册,XDoclet 1.2.3 API,XML指南,网页设计_...
Apache Tomcat 6.x的建立在Tomcat中的5.5.x的改进和实现的Servlet 2.5和 JSP 2.1规范
这一部分使用常见的Apache Group的Tomcat作为JSP引擎的例子。第二部分为JSP高级应用部分。这一部分主要讲述如何使用JSP进行大型Web应用的开发,为了方便读者学习,本书还专门讲述了SUN公司的J2SDKEE和B趴公司的...
后端技术:Servlet,JSP,JDBC 后端框架:SpringMVC,Spring,MyBatis 测试框架:Junit4 测试工具:Apache JMeter 5.4 项目管理工具:Maven Java毕业设计项目:宿递大学生食堂外卖点餐系统技术选型 开发系统:...
C:\Program Files\Apache Software Foundation\Tomcat5.5\common\lib\servlet-api.jar;%JAVA_HOME%\lib\mysql-connector-java-5.1.30-bin-g.jar;C:\Program Files\Java\mysqlforjdbc\mysql-connector-java-5.1.30-...