On Tue, Sep 24, 2013 at 5:21 PM, Daniel Mikusa <dmik...@gopivotal.com>wrote:
>
> A couple general thoughts...
>
> 1.) When looking at log statements at the FINE & lower levels, recognize
> that these are not reporting problems.  They just give you the ability to
> trace the flow of what is happening in the code.  If it was a problem,
> you'd see WARN, ERROR or SEVERE.
>
> 2.) If you'd like a second opinion on something you see in the logs, post
> as much of the logs as possible.  If you only post snippets or filter the
> logs, you might inadvertently filter out something that is important.
>
> 3.) Try a different PC, if you have one available.  If it works on another
> PC, start comparing the two to see what is different.
>
> 4.) Simplify as much as possible.  Start with two fresh Tomcat instance.
>  Add the simplest possible cluster configuration and go from there.
>
>
> https://tomcat.apache.org/tomcat-7.0-doc/cluster-howto.html#For_the_impatient
>
> Sorry I can't be of more help.
>
> Dan
>

Hi all,
Thanks for all your hard work last month on my session replication issue. I
think I've found a solution today (via my SO post
http://stackoverflow.com/questions/18835014/tomcats-clustering-session-replication-not-replicating-properly/19391515#19391515).

The problem appears to be solved by moving the <Manager> element out of the
<Server><Service><Engine><Cluster> element in server.xml and putting it
instead in the <Context> element of context.xml.

So my context.xml now looks like this:
<?xml version='1.0' encoding='utf-8'?>

<!-- The contents of this file will be loaded for each web application -->
<Context useHttpOnly="true" sessionCookiePath="/"
    xmlValidation="false" xmlNamespaceAware="false" >

    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>

    <!-- Clustering / Session replication manager -->
    <Manager className="org.apache.catalina.ha.session.DeltaManager"
             expireSessionsOnShutdown="false"
             notifyListenersOnReplication="true"/>
</Context>

And server.xml still has the <Cluster> element inside <Engine>, but
<Cluster> no longer has a <Manager> element:
    <Engine name="Catalina" defaultHost="localhost">
             <Cluster channelSendOptions="8"

 className="org.apache.catalina.ha.tcp.SimpleTcpCluster">
                <Channel
className="org.apache.catalina.tribes.group.GroupChannel">
                    <Membership address="228.0.0.4"

className="org.apache.catalina.tribes.membership.McastService"
                                dropTime="3000"
                                frequency="500"
                                port="45564"/>
                    <Receiver address="auto"
                              autoBind="100"

className="org.apache.catalina.tribes.transport.nio.NioReceiver"
                              maxThreads="6"
                              port="4000"
                              selectorTimeout="5000"/>
                    <Sender
className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
                        <Transport
className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
                    </Sender>
                    <Interceptor
className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
                    <Interceptor
className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>
                </Channel>
                <Valve
className="org.apache.catalina.ha.tcp.ReplicationValve"
                       filter=""/>
                <Valve
className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>
                <ClusterListener
className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>
                <ClusterListener
className="org.apache.catalina.ha.session.ClusterSessionListener"/>
             </Cluster>

             <!-- etc... -->
    </Engine>

I'll leave it up to you all to determine if the documentation needs to be
updated, or if there's an underlying bug here somewhere, but hopefully this
will help anyone with the same problem in the future.

Thanks,
Nick

Reply via email to