You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alexander Diedler <ad...@tecracer.de> on 2015/02/27 14:15:45 UTC

Persistance on Tomcat 8.0 and Cluster

Hello,
I have to build a two node failover cluster with 2 tomcats 8.0.15 servers.
This cluster is on AWS Cloud, so technical we cannot use Mulicast etc. so we have to use Persistance stored the Session information in a database.
The application was in grails and was delivered as a war file tot he tomcat.

But what I get is this error message in the nodes:
WARNING [localhost-startStop-1] org.apache.catalina.ha.tcp.SimpleTcpCluster.registerManager Manager [ org.apache.catalina.session.PersistentManager[]] does not implement ClusterManager, addition to cluster has been aborted.

In the global /conf/context.xml is this:
<Resource name="jdbc/sessions" auth="Container" type="javax.sql.DataSource"
                               username="username "
                               password="password"
        driverClassName="net.sourceforge.jtds.jdbc.Driver"
        url="jdbc:jtds:Sqlserver://sqlservername:1433/databasename_sessioncontainer;"
        maxActive="1000"
        maxIdle="30"
        maxWait="3600"
        validationQuery="select 1 "
        removeAbandoned="true"
                               removeAbandonedTimeout="60"/>

    <Manager className="org.apache.catalina.session.PersistentManager"
        distributable="true"
        processExpiresFrequency="3"
        saveOnRestart="true"
        minIdleSwap="1800"
        maxIdleSwap="3600"
        maxInactiveInterval="3600"
        maxIdleBackup="0"
        >

        <Store className="org.apache.catalina.session.JDBCStore"
            dataSourceName="jdbc/sessions"
            sessionAppCol="app_name"
            sessionDataCol="session_data"
            sessionIdCol="session_id"
            sessionLastAccessedCol="last_access"
            sessionMaxInactiveCol="max_inactive"
            sessionTable="tomcat_sessions"
            sessionValidCol="valid_session" />
    </Manager>


And in server.xml we use globally:
Inside the engine tag

  <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
                 channelSendOptions="8">


        </Cluster>

What do we wrong?

Greetings
Alexander



AW: Persistance on Tomcat 8.0 and Cluster

Posted by Alexander Diedler <ad...@tecracer.de>.
Hello Christian,
The minimum requirement was tob e redirected to a working node after the current node where I am on are failing.  - This was covered by a Loadbalancer whicht is doing health checks.
The maximum of user friedly was to be stayed logged in into the failover node and not to have re-login into the application. 

Best regards
Alexander 

-----Ursprüngliche Nachricht-----
Von: Christopher Schultz [mailto:chris@christopherschultz.net] 
Gesendet: Freitag, 27. Februar 2015 15:39
An: Tomcat Users List
Betreff: Re: Persistance on Tomcat 8.0 and Cluster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Daniel,

On 2/27/15 9:24 AM, Daniel Mikusa wrote:
> On Fri, Feb 27, 2015 at 8:35 AM, Alexander Diedler 
> <ad...@tecracer.de> wrote:
> 
>> Hello Daniel, That you for your reply. You mean, that session 
>> persistance was enabled and a failover was recordnized by the 
>> loadbalancer and the session was still available on the remaining 
>> node?
>> 
> 
> No. I'm just talking about your configuration.  You have two 
> conflicting things configured.
> 
> 1.) You have a session store created.  This is going to store your 
> sessions into the database.  It's *not* clustering (at least by the 
> definition Tomcat uses), but can be an effective way to share sessions 
> across multiple Tomcat instances.
> 
> 2.) You have a cluster defined.  This is going to tell Tomcat to 
> replicate session data directly between your Tomcat nodes.  As you 
> pointed out previously, this can be problematic on AWS where they 
> don't support multicast.  It's also conflicting with #1, which is what 
> the error you reported is telling you.
> 
> In short, remove the <Cluster/> tag, the error should go away.

Are you sure that's best? If the goal is uninterrupted fail-over, then perhaps using the BackupManager or DeltaManager with static membership is the better strategy.

I guess the real question is for the OP: do you need clustering (i.e.
session replication between nodes) or is it okay if a user has to login again and possibly re-start a workflow if they get failed-over to another node?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJU8IGMAAoJEBzwKT+lPKRY5SQQAIPfDPyKNssUyEOJw5ouA9Qw
7chcfdhWVjiF83ecdXbZSxzS9hRi0l4pNdXVmU/LLQGNGfg+idtusrrG+fa4A4iE
xrs36Wt5DCN2+ejCFlWbrW1Ixk58DTLVdXMJ+F67QTIEp59MmKpGOdTXWlWKs8HI
Xgpq8hEJPMJbaUcEPu87iJbLviVoeWJD9i0TEeA/dcjdl0sR+WdH/VGBtS0TaAkX
ZMaR0Tkp/Fx4hLWUwe2s5QFrQ6n8Mpeggr76owXuSSD2+J0PYPkezs/ctvssn7OJ
YhHWPV5OQ52/YY3FFI5e8pEJZeX2D+FT+XS0CzI7EKsJ+UD9RgU/RVRv/iuKnLA9
GImVr2aAAycCnqGZzDyOrMpO0MfHw9SqLttLdliX8HI383WODYNbrKoON6KaAQRK
MSwqbZ/YJcDczXVjzHxJZnggvhg2IYupQ89quSpf47kKL6bBw3607feiURegvSd5
+xiONk3OifRDbcEv/Q3fGwU5rMYzPaf3f/6Jx0/j9jq/ijVKDUI0fvkqaZnCAev4
o7p67AT6iyH31haRtLL72XFWm6/63hLXQ94qecOKyneAxu8/eWh+ajltAi28mMbk
GFI4iqQCcij9gjcGX++dDoNoe9qGsDj5ZIhVTWXC4hEnsZF64yQG+KHJ+Gss9JV7
rbRTDWfS/YlVI/sBMiUz
=KZKi
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


AW: Persistance on Tomcat 8.0 and Cluster

Posted by Alexander Diedler <ad...@tecracer.de>.
Hello,
Thanks for your ideas and best practises. This solution is for a bank and this peoples are very reserved about "hip technologies". The only goal ist o have High Availability, not load balancing. So we put the session information in a different Microsoft SQL 2008 database, that is independent from the application database.

Best regards
Alexander


-----Ursprüngliche Nachricht-----
Von: Daniel Mikusa [mailto:dmikusa@pivotal.io] 
Gesendet: Freitag, 27. Februar 2015 16:01
An: Tomcat Users List
Betreff: Re: Persistance on Tomcat 8.0 and Cluster

On Fri, Feb 27, 2015 at 9:39 AM, Christopher Schultz < chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Daniel,
>
> On 2/27/15 9:24 AM, Daniel Mikusa wrote:
> > On Fri, Feb 27, 2015 at 8:35 AM, Alexander Diedler 
> > <ad...@tecracer.de> wrote:
> >
> >> Hello Daniel, That you for your reply. You mean, that session 
> >> persistance was enabled and a failover was recordnized by the 
> >> loadbalancer and the session was still available on the remaining 
> >> node?
> >>
> >
> > No. I'm just talking about your configuration.  You have two 
> > conflicting things configured.
> >
> > 1.) You have a session store created.  This is going to store your 
> > sessions into the database.  It's *not* clustering (at least by the 
> > definition Tomcat uses), but can be an effective way to share 
> > sessions across multiple Tomcat instances.
> >
> > 2.) You have a cluster defined.  This is going to tell Tomcat to 
> > replicate session data directly between your Tomcat nodes.  As you 
> > pointed out previously, this can be problematic on AWS where they 
> > don't support multicast.  It's also conflicting with #1, which is 
> > what the error you reported is telling you.
> >
> > In short, remove the <Cluster/> tag, the error should go away.
>
> Are you sure that's best?


My intent was just to answer the question that was asked.  I was trying to stay out of this part of the discussion :)


> If the goal is uninterrupted fail-over, then perhaps using the 
> BackupManager or DeltaManager with static membership is the better 
> strategy.
>

+1 I generally prefer session replication and if static membership will
work I'd agree that's the way to go.  Sometimes that is tricky on AWS because the IP addresses can change, then your config needs updated and it can get messy.

On the subject of what's better, when using a shared storage approach for sessions you'd probably want to go with Redis or Memcached and not a JDBC backed store.  Performance should be much better.

Dan


> I guess the real question is for the OP: do you need clustering (i.e.
> session replication between nodes) or is it okay if a user has to 
> login again and possibly re-start a workflow if they get failed-over 
> to another node?
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJU8IGMAAoJEBzwKT+lPKRY5SQQAIPfDPyKNssUyEOJw5ouA9Qw
> 7chcfdhWVjiF83ecdXbZSxzS9hRi0l4pNdXVmU/LLQGNGfg+idtusrrG+fa4A4iE
> xrs36Wt5DCN2+ejCFlWbrW1Ixk58DTLVdXMJ+F67QTIEp59MmKpGOdTXWlWKs8HI
> Xgpq8hEJPMJbaUcEPu87iJbLviVoeWJD9i0TEeA/dcjdl0sR+WdH/VGBtS0TaAkX
> ZMaR0Tkp/Fx4hLWUwe2s5QFrQ6n8Mpeggr76owXuSSD2+J0PYPkezs/ctvssn7OJ
> YhHWPV5OQ52/YY3FFI5e8pEJZeX2D+FT+XS0CzI7EKsJ+UD9RgU/RVRv/iuKnLA9
> GImVr2aAAycCnqGZzDyOrMpO0MfHw9SqLttLdliX8HI383WODYNbrKoON6KaAQRK
> MSwqbZ/YJcDczXVjzHxJZnggvhg2IYupQ89quSpf47kKL6bBw3607feiURegvSd5
> +xiONk3OifRDbcEv/Q3fGwU5rMYzPaf3f/6Jx0/j9jq/ijVKDUI0fvkqaZnCAev4
> o7p67AT6iyH31haRtLL72XFWm6/63hLXQ94qecOKyneAxu8/eWh+ajltAi28mMbk
> GFI4iqQCcij9gjcGX++dDoNoe9qGsDj5ZIhVTWXC4hEnsZF64yQG+KHJ+Gss9JV7
> rbRTDWfS/YlVI/sBMiUz
> =KZKi
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Persistance on Tomcat 8.0 and Cluster

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Daniel,

On 2/27/15 10:00 AM, Daniel Mikusa wrote:
> On Fri, Feb 27, 2015 at 9:39 AM, Christopher Schultz < 
> chris@christopherschultz.net> wrote:
> 
> Daniel,
> 
> On 2/27/15 9:24 AM, Daniel Mikusa wrote:
>>>> On Fri, Feb 27, 2015 at 8:35 AM, Alexander Diedler 
>>>> <ad...@tecracer.de> wrote:
>>>> 
>>>>> Hello Daniel, That you for your reply. You mean, that
>>>>> session persistance was enabled and a failover was
>>>>> recordnized by the loadbalancer and the session was still
>>>>> available on the remaining node?
>>>>> 
>>>> 
>>>> No. I'm just talking about your configuration.  You have two 
>>>> conflicting things configured.
>>>> 
>>>> 1.) You have a session store created.  This is going to store
>>>> your sessions into the database.  It's *not* clustering (at
>>>> least by the definition Tomcat uses), but can be an effective
>>>> way to share sessions across multiple Tomcat instances.
>>>> 
>>>> 2.) You have a cluster defined.  This is going to tell Tomcat
>>>> to replicate session data directly between your Tomcat nodes.
>>>> As you pointed out previously, this can be problematic on AWS
>>>> where they don't support multicast.  It's also conflicting
>>>> with #1, which is what the error you reported is telling
>>>> you.
>>>> 
>>>> In short, remove the <Cluster/> tag, the error should go
>>>> away.
> 
> Are you sure that's best?
> 
> 
>> My intent was just to answer the question that was asked.  I was
>> trying to stay out of this part of the discussion :)
> 
> 
> If the goal is uninterrupted fail-over, then perhaps using the
> BackupManager or DeltaManager with static membership is the better
> strategy.
> 
> 
>> +1 I generally prefer session replication and if static
>> membership will work I'd agree that's the way to go.  Sometimes
>> that is tricky on AWS because the IP addresses can change, then
>> your config needs updated and it can get messy.

Once booted, the IP address won't change, but you are right: if you
want to be "agile" on AWS (which is kind of the whole point), then you
have to figure out how to play the IP address game.

One option is using something like n2n to create a network space where
multicast can work. It seems like a total pain in the neck to me, though.

>> On the subject of what's better, when using a shared storage
>> approach for sessions you'd probably want to go with Redis or
>> Memcached and not a JDBC backed store.  Performance should be
>> much better.

Although I've neither tried nor benchmarked either of these solutions,
I suspect that you are correct in that some kind of key-value store is
going to give higher performance than a relational database. Note that
Memcached in particular is totally ephemeral (without some heroic
measures) and so your session store can disappear on you if you aren't
careful.

If the OP wants the user's login to follow them, I think formal
clustering is required, depending upon the authentication setup:
without clustering, I think Tomcat will require a re-login on
fail-over unless session replication has been enabled, because certain
authentication information is tied to the session but not in session
attributes (which are the only things stored in the database when
using PersistentStore). Then again, I have zero experience with this
and may be completely incorrect.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJU8JEiAAoJEBzwKT+lPKRYjZYP/ieEXmqG4Kh3MAg+jo6aWzTV
QmFG+iRFme7yV6EU/e7R57RgqqY9NW+RxMOyI9/kxIlQRleDTcMeSDWchymf/KoY
ITdKN7+la/PqUzEvyrehqaO8L7RpNNaaUMnhxSNiVfgD2zlbPq/85XZzSUauUxlA
2aiT7dig1dIT6S729rsg2wNIzMSriVLhP1D2N3rwBvEVarccxehFVXDz//xYdtJU
bWEZVUQLdu4J6Qzx9q8mQSyP3Gho3zi52qQ6YhLglMoIZEJU/v1ImGGpLYlmyr/C
nOg3dKVc469q5xqRPEphwr9XGcM4fM3K6qelDz9L9e0OpbBb3rU5a92D0nAQM8xe
Blr2JahaZdXJrsOvz8gqHzet0SUI4pEgANFhB+66Lw6dZejIHCK6eTdgpvgyBvIY
Mz6zRID+5u6ftaZzhtPUDOzHj7kP5u8zdmrSITF/g9Ryqw4a2lem4DML01UQM++v
LcdfTRujDlwBz9ktr7gVS6mpzMtwoLB0IhEY0D26sBXZIIQkWGr7dYFYJn6Zq79P
/2yy7ZqIwDr0Onh97w0vVto1arr5ivBTMna9wbE565cq+minzIHPi6kTlNFMBH6S
YPca8Wl2G/zm25OF8Y9m8LKDf65wKM6ZOjjCFGOiK2ywnFxj2OuCcuKdNcoe2h5F
FRPI7jfq4mAAcWQRuyKD
=ABjN
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Persistance on Tomcat 8.0 and Cluster

Posted by Daniel Mikusa <dm...@pivotal.io>.
On Fri, Feb 27, 2015 at 9:39 AM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Daniel,
>
> On 2/27/15 9:24 AM, Daniel Mikusa wrote:
> > On Fri, Feb 27, 2015 at 8:35 AM, Alexander Diedler
> > <ad...@tecracer.de> wrote:
> >
> >> Hello Daniel, That you for your reply. You mean, that session
> >> persistance was enabled and a failover was recordnized by the
> >> loadbalancer and the session was still available on the
> >> remaining node?
> >>
> >
> > No. I'm just talking about your configuration.  You have two
> > conflicting things configured.
> >
> > 1.) You have a session store created.  This is going to store your
> > sessions into the database.  It's *not* clustering (at least by
> > the definition Tomcat uses), but can be an effective way to share
> > sessions across multiple Tomcat instances.
> >
> > 2.) You have a cluster defined.  This is going to tell Tomcat to
> > replicate session data directly between your Tomcat nodes.  As you
> > pointed out previously, this can be problematic on AWS where they
> > don't support multicast.  It's also conflicting with #1, which is
> > what the error you reported is telling you.
> >
> > In short, remove the <Cluster/> tag, the error should go away.
>
> Are you sure that's best?


My intent was just to answer the question that was asked.  I was trying to
stay out of this part of the discussion :)


> If the goal is uninterrupted fail-over, then
> perhaps using the BackupManager or DeltaManager with static membership
> is the better strategy.
>

+1 I generally prefer session replication and if static membership will
work I'd agree that's the way to go.  Sometimes that is tricky on AWS
because the IP addresses can change, then your config needs updated and it
can get messy.

On the subject of what's better, when using a shared storage approach for
sessions you'd probably want to go with Redis or Memcached and not a JDBC
backed store.  Performance should be much better.

Dan


> I guess the real question is for the OP: do you need clustering (i.e.
> session replication between nodes) or is it okay if a user has to
> login again and possibly re-start a workflow if they get failed-over
> to another node?
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJU8IGMAAoJEBzwKT+lPKRY5SQQAIPfDPyKNssUyEOJw5ouA9Qw
> 7chcfdhWVjiF83ecdXbZSxzS9hRi0l4pNdXVmU/LLQGNGfg+idtusrrG+fa4A4iE
> xrs36Wt5DCN2+ejCFlWbrW1Ixk58DTLVdXMJ+F67QTIEp59MmKpGOdTXWlWKs8HI
> Xgpq8hEJPMJbaUcEPu87iJbLviVoeWJD9i0TEeA/dcjdl0sR+WdH/VGBtS0TaAkX
> ZMaR0Tkp/Fx4hLWUwe2s5QFrQ6n8Mpeggr76owXuSSD2+J0PYPkezs/ctvssn7OJ
> YhHWPV5OQ52/YY3FFI5e8pEJZeX2D+FT+XS0CzI7EKsJ+UD9RgU/RVRv/iuKnLA9
> GImVr2aAAycCnqGZzDyOrMpO0MfHw9SqLttLdliX8HI383WODYNbrKoON6KaAQRK
> MSwqbZ/YJcDczXVjzHxJZnggvhg2IYupQ89quSpf47kKL6bBw3607feiURegvSd5
> +xiONk3OifRDbcEv/Q3fGwU5rMYzPaf3f/6Jx0/j9jq/ijVKDUI0fvkqaZnCAev4
> o7p67AT6iyH31haRtLL72XFWm6/63hLXQ94qecOKyneAxu8/eWh+ajltAi28mMbk
> GFI4iqQCcij9gjcGX++dDoNoe9qGsDj5ZIhVTWXC4hEnsZF64yQG+KHJ+Gss9JV7
> rbRTDWfS/YlVI/sBMiUz
> =KZKi
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Persistance on Tomcat 8.0 and Cluster

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Daniel,

On 2/27/15 9:24 AM, Daniel Mikusa wrote:
> On Fri, Feb 27, 2015 at 8:35 AM, Alexander Diedler 
> <ad...@tecracer.de> wrote:
> 
>> Hello Daniel, That you for your reply. You mean, that session 
>> persistance was enabled and a failover was recordnized by the 
>> loadbalancer and the session was still available on the
>> remaining node?
>> 
> 
> No. I'm just talking about your configuration.  You have two 
> conflicting things configured.
> 
> 1.) You have a session store created.  This is going to store your 
> sessions into the database.  It's *not* clustering (at least by
> the definition Tomcat uses), but can be an effective way to share 
> sessions across multiple Tomcat instances.
> 
> 2.) You have a cluster defined.  This is going to tell Tomcat to 
> replicate session data directly between your Tomcat nodes.  As you 
> pointed out previously, this can be problematic on AWS where they 
> don't support multicast.  It's also conflicting with #1, which is 
> what the error you reported is telling you.
> 
> In short, remove the <Cluster/> tag, the error should go away.

Are you sure that's best? If the goal is uninterrupted fail-over, then
perhaps using the BackupManager or DeltaManager with static membership
is the better strategy.

I guess the real question is for the OP: do you need clustering (i.e.
session replication between nodes) or is it okay if a user has to
login again and possibly re-start a workflow if they get failed-over
to another node?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJU8IGMAAoJEBzwKT+lPKRY5SQQAIPfDPyKNssUyEOJw5ouA9Qw
7chcfdhWVjiF83ecdXbZSxzS9hRi0l4pNdXVmU/LLQGNGfg+idtusrrG+fa4A4iE
xrs36Wt5DCN2+ejCFlWbrW1Ixk58DTLVdXMJ+F67QTIEp59MmKpGOdTXWlWKs8HI
Xgpq8hEJPMJbaUcEPu87iJbLviVoeWJD9i0TEeA/dcjdl0sR+WdH/VGBtS0TaAkX
ZMaR0Tkp/Fx4hLWUwe2s5QFrQ6n8Mpeggr76owXuSSD2+J0PYPkezs/ctvssn7OJ
YhHWPV5OQ52/YY3FFI5e8pEJZeX2D+FT+XS0CzI7EKsJ+UD9RgU/RVRv/iuKnLA9
GImVr2aAAycCnqGZzDyOrMpO0MfHw9SqLttLdliX8HI383WODYNbrKoON6KaAQRK
MSwqbZ/YJcDczXVjzHxJZnggvhg2IYupQ89quSpf47kKL6bBw3607feiURegvSd5
+xiONk3OifRDbcEv/Q3fGwU5rMYzPaf3f/6Jx0/j9jq/ijVKDUI0fvkqaZnCAev4
o7p67AT6iyH31haRtLL72XFWm6/63hLXQ94qecOKyneAxu8/eWh+ajltAi28mMbk
GFI4iqQCcij9gjcGX++dDoNoe9qGsDj5ZIhVTWXC4hEnsZF64yQG+KHJ+Gss9JV7
rbRTDWfS/YlVI/sBMiUz
=KZKi
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Persistance on Tomcat 8.0 and Cluster

Posted by Daniel Mikusa <dm...@pivotal.io>.
On Fri, Feb 27, 2015 at 8:35 AM, Alexander Diedler <ad...@tecracer.de>
wrote:

> Hello Daniel,
> That you for your reply. You mean, that session persistance was enabled
> and a failover was recordnized by the loadbalancer and the session was
> still available on the remaining node?
>

No. I'm just talking about your configuration.  You have two conflicting
things configured.

1.) You have a session store created.  This is going to store your sessions
into the database.  It's *not* clustering (at least by the definition
Tomcat uses), but can be an effective way to share sessions across multiple
Tomcat instances.

2.) You have a cluster defined.  This is going to tell Tomcat to replicate
session data directly between your Tomcat nodes.  As you pointed out
previously, this can be problematic on AWS where they don't support
multicast.  It's also conflicting with #1, which is what the error you
reported is telling you.

In short, remove the <Cluster/> tag, the error should go away.

Dan



> -----Ursprüngliche Nachricht-----
> Von: Daniel Mikusa [mailto:dmikusa@pivotal.io]
> Gesendet: Freitag, 27. Februar 2015 14:21
> An: Tomcat Users List
> Betreff: Re: Persistance on Tomcat 8.0 and Cluster
>
> On Fri, Feb 27, 2015 at 8:15 AM, Alexander Diedler <ad...@tecracer.de>
> wrote:
>
> > Hello,
> > I have to build a two node failover cluster with 2 tomcats 8.0.15
> servers.
> > This cluster is on AWS Cloud, so technical we cannot use Mulicast etc.
> > so we have to use Persistance stored the Session information in a
> database.
> > The application was in grails and was delivered as a war file tot he
> > tomcat.
> >
> > But what I get is this error message in the nodes:
> > WARNING [localhost-startStop-1]
> > org.apache.catalina.ha.tcp.SimpleTcpCluster.registerManager Manager [
> > org.apache.catalina.session.PersistentManager[]] does not implement
> > ClusterManager, addition to cluster has been aborted.
> >
> > In the global /conf/context.xml is this:
> > <Resource name="jdbc/sessions" auth="Container"
> type="javax.sql.DataSource"
> >                                username="username "
> >                                password="password"
> >         driverClassName="net.sourceforge.jtds.jdbc.Driver"
> >
> >
> url="jdbc:jtds:Sqlserver://sqlservername:1433/databasename_sessioncontainer;"
> >         maxActive="1000"
> >         maxIdle="30"
> >         maxWait="3600"
> >         validationQuery="select 1 "
> >         removeAbandoned="true"
> >                                removeAbandonedTimeout="60"/>
> >
> >     <Manager className="org.apache.catalina.session.PersistentManager"
> >         distributable="true"
> >         processExpiresFrequency="3"
> >         saveOnRestart="true"
> >         minIdleSwap="1800"
> >         maxIdleSwap="3600"
> >         maxInactiveInterval="3600"
> >         maxIdleBackup="0"
> >         >
> >
> >         <Store className="org.apache.catalina.session.JDBCStore"
> >             dataSourceName="jdbc/sessions"
> >             sessionAppCol="app_name"
> >             sessionDataCol="session_data"
> >             sessionIdCol="session_id"
> >             sessionLastAccessedCol="last_access"
> >             sessionMaxInactiveCol="max_inactive"
> >             sessionTable="tomcat_sessions"
> >             sessionValidCol="valid_session" />
> >     </Manager>
> >
> >
> > And in server.xml we use globally:
> > Inside the engine tag
> >
> >   <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
> >                  channelSendOptions="8">
> >
> >
> >         </Cluster>
> >
> > What do we wrong?
> >
>
> If you're using session persistence like a DB to share your sessions
> across multiple nodes, you don't need the <Cluster /> tag.  That's only
> necessary if you're replicating sessions directly between your cluster
> nodes.
>
> Dan
>
>
> >
> > Greetings
> > Alexander
> >
> >
> >
>

AW: Persistance on Tomcat 8.0 and Cluster

Posted by Alexander Diedler <ad...@tecracer.de>.
Hello Daniel,
That you for your reply. You mean, that session persistance was enabled and a failover was recordnized by the loadbalancer and the session was still available on the remaining node?

Thank you.


-----Ursprüngliche Nachricht-----
Von: Daniel Mikusa [mailto:dmikusa@pivotal.io] 
Gesendet: Freitag, 27. Februar 2015 14:21
An: Tomcat Users List
Betreff: Re: Persistance on Tomcat 8.0 and Cluster

On Fri, Feb 27, 2015 at 8:15 AM, Alexander Diedler <ad...@tecracer.de>
wrote:

> Hello,
> I have to build a two node failover cluster with 2 tomcats 8.0.15 servers.
> This cluster is on AWS Cloud, so technical we cannot use Mulicast etc. 
> so we have to use Persistance stored the Session information in a database.
> The application was in grails and was delivered as a war file tot he 
> tomcat.
>
> But what I get is this error message in the nodes:
> WARNING [localhost-startStop-1]
> org.apache.catalina.ha.tcp.SimpleTcpCluster.registerManager Manager [ 
> org.apache.catalina.session.PersistentManager[]] does not implement 
> ClusterManager, addition to cluster has been aborted.
>
> In the global /conf/context.xml is this:
> <Resource name="jdbc/sessions" auth="Container" type="javax.sql.DataSource"
>                                username="username "
>                                password="password"
>         driverClassName="net.sourceforge.jtds.jdbc.Driver"
>
> url="jdbc:jtds:Sqlserver://sqlservername:1433/databasename_sessioncontainer;"
>         maxActive="1000"
>         maxIdle="30"
>         maxWait="3600"
>         validationQuery="select 1 "
>         removeAbandoned="true"
>                                removeAbandonedTimeout="60"/>
>
>     <Manager className="org.apache.catalina.session.PersistentManager"
>         distributable="true"
>         processExpiresFrequency="3"
>         saveOnRestart="true"
>         minIdleSwap="1800"
>         maxIdleSwap="3600"
>         maxInactiveInterval="3600"
>         maxIdleBackup="0"
>         >
>
>         <Store className="org.apache.catalina.session.JDBCStore"
>             dataSourceName="jdbc/sessions"
>             sessionAppCol="app_name"
>             sessionDataCol="session_data"
>             sessionIdCol="session_id"
>             sessionLastAccessedCol="last_access"
>             sessionMaxInactiveCol="max_inactive"
>             sessionTable="tomcat_sessions"
>             sessionValidCol="valid_session" />
>     </Manager>
>
>
> And in server.xml we use globally:
> Inside the engine tag
>
>   <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
>                  channelSendOptions="8">
>
>
>         </Cluster>
>
> What do we wrong?
>

If you're using session persistence like a DB to share your sessions across multiple nodes, you don't need the <Cluster /> tag.  That's only necessary if you're replicating sessions directly between your cluster nodes.

Dan


>
> Greetings
> Alexander
>
>
>

Re: Persistance on Tomcat 8.0 and Cluster

Posted by Daniel Mikusa <dm...@pivotal.io>.
On Fri, Feb 27, 2015 at 8:15 AM, Alexander Diedler <ad...@tecracer.de>
wrote:

> Hello,
> I have to build a two node failover cluster with 2 tomcats 8.0.15 servers.
> This cluster is on AWS Cloud, so technical we cannot use Mulicast etc. so
> we have to use Persistance stored the Session information in a database.
> The application was in grails and was delivered as a war file tot he
> tomcat.
>
> But what I get is this error message in the nodes:
> WARNING [localhost-startStop-1]
> org.apache.catalina.ha.tcp.SimpleTcpCluster.registerManager Manager [
> org.apache.catalina.session.PersistentManager[]] does not implement
> ClusterManager, addition to cluster has been aborted.
>
> In the global /conf/context.xml is this:
> <Resource name="jdbc/sessions" auth="Container" type="javax.sql.DataSource"
>                                username="username "
>                                password="password"
>         driverClassName="net.sourceforge.jtds.jdbc.Driver"
>
> url="jdbc:jtds:Sqlserver://sqlservername:1433/databasename_sessioncontainer;"
>         maxActive="1000"
>         maxIdle="30"
>         maxWait="3600"
>         validationQuery="select 1 "
>         removeAbandoned="true"
>                                removeAbandonedTimeout="60"/>
>
>     <Manager className="org.apache.catalina.session.PersistentManager"
>         distributable="true"
>         processExpiresFrequency="3"
>         saveOnRestart="true"
>         minIdleSwap="1800"
>         maxIdleSwap="3600"
>         maxInactiveInterval="3600"
>         maxIdleBackup="0"
>         >
>
>         <Store className="org.apache.catalina.session.JDBCStore"
>             dataSourceName="jdbc/sessions"
>             sessionAppCol="app_name"
>             sessionDataCol="session_data"
>             sessionIdCol="session_id"
>             sessionLastAccessedCol="last_access"
>             sessionMaxInactiveCol="max_inactive"
>             sessionTable="tomcat_sessions"
>             sessionValidCol="valid_session" />
>     </Manager>
>
>
> And in server.xml we use globally:
> Inside the engine tag
>
>   <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
>                  channelSendOptions="8">
>
>
>         </Cluster>
>
> What do we wrong?
>

If you're using session persistence like a DB to share your sessions across
multiple nodes, you don't need the <Cluster /> tag.  That's only necessary
if you're replicating sessions directly between your cluster nodes.

Dan


>
> Greetings
> Alexander
>
>
>