zj2092 发表于 2017-1-13 10:03:35

apache 2.2.15 +tomcat 6.0 同一台机器集群

  今天配乐一下,负载平衡没有问题,但是在同一台机器上面,session复制总是失败 :(
  参考网站
  http://wangzhen-1104.iteye.com/?page=3&show_full=true
  http://www.iteye.com/topic/675914
  http://www.ibm.com/developerworks/cn/opensource/os-lo-apache-tomcat/
  http://blog.csdn.net/longaohun/archive/2010/05/11/5577324.aspx
  http://blog.csdn.net/longaohun/archive/2010/05/11/5577324.aspx
  官方
  http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html#Bind%20session%20after%20crash%20to%20failover%20node
  http://tomcat.apache.org/connectors-doc/reference/workers.html

[*]All your session attributes must implement java.io.Serializable
[*]Uncomment the Cluster element in server.xml
[*]If you have defined custom cluster valves, make sure you have the ReplicationValve defined as well under the Cluster element in server.xml
[*]If your Tomcat instances are running on the same machine, make sure the tcpListenPort attribute is unique for each instance, in most cases Tomcat is smart enough to resolve this on it's own by autodetecting available ports in the range 4000-4100
[*]Make sure your web.xml has the <distributable/> element or set at your <Context distributable="true" />
[*]If you are using mod_jk, make sure that jvmRoute attribute is set at your Engine <Engine name="Catalina" jvmRoute="node01" > and that the jvmRoute attribute value matches your worker name in workers.properties
[*]Make sure that all nodes have the same time and sync with NTP service!
[*]Make sure that your loadbalancer is configured for sticky session mode.
  只能是sticky session??
  集群还有其他很多方案
页: [1]
查看完整版本: apache 2.2.15 +tomcat 6.0 同一台机器集群