• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Clustering losing session

New Here ,
Mar 18, 2015 Mar 18, 2015

Copy link to clipboard

Copied

I have been trying to get clustering going but sessions never work. In a virtual machine, I have CF11 Enterprise on Windows installed. The VM was copied from a staging environment that was previously setup following the common "CF Lockdown Guide", but I don't believe we're having an issue there.

I have stripped the VM down to the basics and reverted many "lockdown" changes. The CF services are setup to run as an administrator. I have two websites in IIS - one basic index.cfm site that dumps instance name, and a full site that is dumping instance name, alongside having a login and much functionality. Three instances are setup in CF Admin - cfusion, Instance1, and Instance2. Instance1 and Instance2 are both part of a cluster, Cluster1.

I have tried all combinations of "sticky sessions" and "session replication", reinstalling the CF Connectors (tried both globally and per-site) and Handler Mappings each setting update. Services were restarted after each change, as necessary.

I have also tried moving the "Cluster" node in each Instance's server.xml to be contained within the Host node, but it did nothing.

Neither Sticky Sessions or Session Replication seem to work. Each requests goes to the next instance (set as 1/1 load balancing factor). Session replication doesn't work as I can never login. Sticky sessions never work as each subsequent request hits the next instance, apparently invalidating the login request. I can make other updates to the load balancing, such as changing the factor to 5/1 and having Instance1 take 5 requests for every 1 of Instance2, but session ID's and replication do not appear to be working.

My first attempt at this was on CF10. It had the exact same problem (with a difference being that Session Replication isn't a check-able option in CF Admin).

Does anyone have any other ideas of what to try? There isn't much on Google, and I've already seen all pages/forum posts that seem to apply to my issue.

Views

726

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Mar 18, 2015 Mar 18, 2015

CFadmin > Server Settings > Memory Variables  tick Use J2EE session variables on each instance. Perhaps you might have to restart those to take effect.

HTH, Carl.

Votes

Translate

Translate
Guide ,
Mar 18, 2015 Mar 18, 2015

Copy link to clipboard

Copied

CFadmin > Server Settings > Memory Variables  tick Use J2EE session variables on each instance. Perhaps you might have to restart those to take effect.

HTH, Carl.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 19, 2015 Mar 19, 2015

Copy link to clipboard

Copied

Carl’s suggestion is certainly of first importance. If you’d not done that, Masejoer, that may be all you need.

If you HAD done that, I will say that trying to resolve this remotely via email will prove knotty.

And this is why you find little discussion on the topic in google searches. There are just too many moving parts: how you installed CF, how you configured the cluster in CF (in the primary server and then in the remote one), indeed whether you are talking about instances within one machine or between machines, what instructions you followed, and so on. Even factors like how your code is written can have an influence.

The bottom line is that session replication can work. I have done configured it for folks and confirmed it was working fully as expected, with CF11.

But often it takes only a slight miss of something for it not to work. Once you solve that, it then often works just find from that point forward. (Then again, other problems can hit you if you end up having thousands or tens of thousands of sessions unexpectedly being replicated all the time between instances, but that’s a separate issue. We can cross that bridge when you come to it.)

All this is to say that we can’t in email consider all the possibilities that may be making things not work for you. But you can solve it, by looking at the right things, the right way.

If this is important for you to resolve from a business perspective, you may do best by having someone work with you remotely (where they see your screen while look at your setup). With that approach, this might be solved in as little as 15 minutes, because we don’t have to consider remotely and one step at a time all the possibilities and narrow down to the problem with a lot of back and forth. Instead, all that happens in minutes based on what’s presented in your setup, and based on review of some diagnostic tests.

This sort of remote assistance does not require the assistant to be given remote access (opening a firewall, creating an account). Instead, the remote assistance just “looks over your shoulder” using a service like join.me, gotomeeting, etc. I’ll say that I do that sort of troubleshooting consulting and am fairly confident we could quickly resolve your problem. But so that this does not seem to be purely a “sales pitch”, I’ll point out that I list several such consultants in a category of my CF411.com site, specifically cf411.com/cfconsult.

Hope that’s helpful.

/charlie


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 19, 2015 Mar 19, 2015

Copy link to clipboard

Copied

LATEST

This is all exploratory testing at the moment.

I was missing the J2EE session-variable setting on the CF instances. Sticky sessions and replication appears to be working now. One remaining issue though - I am unable to get the CF instances to start-up with Sticky Sessions enabled, Session Replication disabled. Nothing useful is appearing in the ColdFusion logs. If I delete the log files and attempt to start the instances, only coldfusion-error.log is populated. After a couple minutes, the services stop after failing to start.

Mar 19, 2015 11:14:48 AM org.apache.catalina.core.AprLifecycleListener init

INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\ColdFusion11\Instance2\lib;C:\ColdFusion11\Instance2\jintegra\bin;C:\ColdFusion11\Instance2\jintegra\bin\international;C:\ColdFusion11\Instance2\lib\oosdk\classes\win

Mar 19, 2015 11:14:49 AM org.apache.coyote.AbstractProtocol init

INFO: Initializing ProtocolHandler ["ajp-bio-8013"]

Mar 19, 2015 11:14:49 AM org.apache.coyote.AbstractProtocol init

INFO: Initializing ProtocolHandler ["http-nio-8501"]

Mar 19, 2015 11:14:49 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector

INFO: Using a shared selector for servlet write/read

Mar 19, 2015 11:14:49 AM org.apache.catalina.core.StandardService startInternal

INFO: Starting service Catalina

Mar 19, 2015 11:14:49 AM org.apache.catalina.core.StandardEngine startInternal

INFO: Starting Servlet Engine: Apache Tomcat/7.0.54

Mar 19, 2015 11:14:49 AM org.apache.catalina.ha.tcp.SimpleTcpCluster startInternal

INFO: Cluster is about to start

Mar 19, 2015 11:14:49 AM org.apache.catalina.tribes.transport.ReceiverBase bind

INFO: Receiver Server Socket bound to:/192.168.0.14:4002

Mar 19, 2015 11:14:49 AM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket

INFO: Setting cluster mcast soTimeout to 500

Mar 19, 2015 11:14:49 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers

INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4

Mar 19, 2015 11:14:49 AM org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded

INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{192, 168, 0, 14}:4001,{192, 168, 0, 14},4001, alive=1516, securePort=-1, UDP Port=-1, id={-22 97 123 -80 119 -97 77 -75 -97 -77 -16 82 -114 70 96 109 }, payload={}, command={}, domain={}, ]

Mar 19, 2015 11:14:49 AM org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded

INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{192, 168, 0, 19}:4001,{192, 168, 0, 19},4001, alive=766813963, securePort=-1, UDP Port=-1, id={32 60 -93 -104 -4 -62 67 107 -74 13 -128 16 121 -30 57 20 }, payload={}, command={}, domain={}, ]

Mar 19, 2015 11:14:49 AM org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded

INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{192, 168, 0, 19}:4002,{192, 168, 0, 19},4002, alive=766813963, securePort=-1, UDP Port=-1, id={-54 30 -101 46 -2 23 66 20 -74 92 -61 -6 34 -22 -76 52 }, payload={}, command={}, domain={}, ]

Mar 19, 2015 11:14:50 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers

INFO: Done sleeping, membership established, start level:4

Mar 19, 2015 11:14:50 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers

INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:8

Mar 19, 2015 11:14:50 AM org.apache.catalina.tribes.io.BufferPool getBufferPool

INFO: Created a buffer pool with max size:104857600 bytes of type:org.apache.catalina.tribes.io.BufferPool15Impl

Mar 19, 2015 11:14:51 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers

INFO: Done sleeping, membership established, start level:8

Windows Event Log Info:

Description:

The description for Event ID 261 from source ColdFusion 11 Application Server Instance2 cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

The following information was included with the event:

ColdFusion 11 Application Server Instance2

240

C:\ColdFusion11\Instance2\bin\coldfusionsvc.exe

ColdFusion 11 Application Server Instance2

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation