This documentation is for WSO2 Application Server 5.2.0. View documentation for the latest release.
Page Comparison - Clustering and Http Session Replication (v.4 vs v.5) - Application Server 5.2.0 - WSO2 Documentation

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Web Application session replication is enabled in a clustered environment from WSO2 Application Server 5.0.0 onwards . Therefore, when a Web application is defined as "distributable" and once a session is created for it from a node, that session gets replicated to other nodes. The subsequent changes in the session from any node will also get replicated to other nodes. The same session replication mechanism from Tomcat  is used here, except for Axis2 Hazelcast used to send the session replication messages across the cluster.

There are some custom changes required to enable this session replication from Tomcat to WSO2 Carbon. For example, WSO2 has developed its own TomcatValve to start the session replication process and own implementation of ClusterableSessionManager, which is responsible for handling session for a distributable Web application and sending session replication messages.

  Follow the instructions below to enable session replication in a WSO2 Application Server cluster:

  1. First enable clustering in Axis2. We also have to enable clustering for the Catalina engine by adding the following in between the <Engine></Engine> tags in catalina-server.xml file.       

    Code Block
    <Cluster className="org.wso2.carbon.core.session.CarbonTomcatSimpleTcpCluster"/>
  2. Add the following TomcatValvefor <Host> which is responsible for starting the replication of session. This should be the first of the Tomcat valves.       

    Code Block
    <Valve className="org.wso2.carbon.tomcat.ext.valves.CarbonTomcatSessionReplicationValve"/>
  3. Make the Web application distributable by defining the property <distributable/> in the web.xml file. Then, deploy it in the Application Server.

The above steps should also be implemented for other Application Server nodes in the cluster, for which session replication should be enabled. These steps are the standard steps for session replication in a standalone Tomcat cluster environment.