故障转移时Tomcat 7会话复制问题

时间:2016-04-11 21:33:10

标签: java session tomcat hazelcast

我们最近使用2个tomcat节点(7.0.53)对我们的应用程序进行了集群,并根据Tomcat文档设置了集群https://tomcat.apache.org/tomcat-7.0-doc/cluster-howto.html

一切都按预期工作,除了会话复制在故障转移时不起作用,我必须在两个tomcat实例上设置The output should be like DOUBLE COUNT 01 02 10 (as example) 03 04 12 (as example) I am getting duplicated like... 01 02 10 (as example) 01 02 10 (as example) <?php if ($check == 'doubles'){ sort($doubles); foreach ($doubles as $double) { explode(" ", $double); $dn1 = $double[0].$double[1]; $dn2 = $double[2].$double[3]; if ($stmt = $post_con->prepare('SELECT DISTINCT FROM tb WHERE CONCAT(" ", res, " ") LIKE CONCAT("% ", ?, " %") AND CONCAT(" ", res, " ") LIKE CONCAT("% ", ?, " %")')) { $stmt->bind_param("ss", $dn1, $dn2); $dn1 = sprintf('%02d', $dn1); $dn2 = sprintf('%02d', $dn2); $stmt->execute(); $stmt->store_result(); $qty = $stmt->num_rows; echo '<div class="mini">'.$dn1.'</div>'; echo '<div class="mini">'.$dn2.'</div>'; echo '<div class="n-sort">'.$qty.'</div>'; } } ?> 以使会话复制工作。我提到hazelcast文档来设置http://docs.hazelcast.org/docs/3.5/manual/html/websessionreplication.html,会话复制在tomcat失败时完美运行。我只是想知道这是Tomcat会话复制的一个错误吗?或者是否必须使用hazelcast等第三方库来实现tomcat失败的会话复制?

0 个答案:

没有答案