1

I am not able to set up a cluster with session replication. I have successfully set up a cluster with sticky session. When googled I found a lot of links explaining the same issue, like

  1. http://cfmlblog.adamcameron.me/2012/11/problem-with-session-replication-with.html

  2. https://forums.adobe.com/thread/1238702?start=0&tstart=0

Does deselecting the sticky session auto enables the session replication?

But no where i got a solutions. Anyone solved this problem?

user3427540
  • 169
  • 2
  • 9

1 Answers1

0

Cross posting here from my answer on StackOverflow to this same question

From the article you included by Adam Cameron he mentions having trouble with session replication - Problem with session replication with CF10 clustering. The key here is that a bug was entered for ColdFusion 10 (3361502) not having the option to enable session replication in the Administrator. That bug has since been fixed. Are you running the updated version?

In one of the comments from that bug someone from Adobe mentions this:

When sticky session is enabled the session is not replicated and when sticky session is disabled the session is automatically replicated.

So it would seem that in ColdFusion 10 when you disable sticky sessions, that should enable session replication. You must also enable J2EE session variables.

There are also some limitations with session replication. From the docs here:

Session replication also ensures that that Session scope variables are replicated across the cluster. However, session replication does not support replication of arrays in Session scope CFCs or variables.

After a brief chat I referred the OP to this article - Working with Tomcat as the built-in application server which goes into greater detail about working with clusters in ColdFusion 10. Of particular interest is the section regarding cluster management titled "Adding remote instance to the cluster". In there it mentions some additions that need to be made to the server.xml file on each remote instance.

Use the following steps to add a remote instance to a cluster:

  1. Register the remote instance to local machine.
  2. Create a cluster in the local machine.
  3. Open the cf_install_dir\instance-name\runtime\conf\server.xml file of the remote instance.
  4. Add the following block between the entries </host> and </engine> :
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" channelSendOptions="8">
    <Manager notifyListenersOnReplication="true" expireSessionsOnShutdown="false" className="org.apache.catalina.ha.session.DeltaManager">
</Manager>
<Channel className="org.apache.catalina.tribes.group.GroupChannel">
    <Membership port="45565" dropTime="3000" address="228.0.0.4" className="org.apache.catalina.tribes.membership.McastService" frequency="500">
    </Membership>
    <Receiver port="4003" autoBind="100" address="auto" selectorTimeout="5000" maxThreads="6" className="org.apache.catalina.tribes.transport.nio.NioReceiver">
    </Receiver>
    <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
        <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender">
        </Transport>
    </Sender>
    <Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector">
    </Interceptor>
    <Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor">
    </Interceptor>
</Channel>
<Valve className="org.apache.catalina.ha.tcp.ReplicationValve" filter="">
</Valve>
<Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve">
</Valve>
<ClusterListener className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener">
</ClusterListener>
<ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener”>
</ClusterListener>
</Cluster>

5 . In the entry above, update the membership port with the multicast port of the cluster.

6 . Using ColdFusion administrator of the local host, add the local instance and the remote instance to the cluster.

Note: If you enable sticky sessions, the JVM route of the remote instance and local instance must not be the same.

7 . Restart all of the instances.

Miguel-F
  • 302
  • 3
  • 11