The problem is that my application is running on AWS which apparently
doesn't support multicasting so I can't use Tomcat's DeltaManager. I
thought of using one of the Store implementations for PersistentManager but
that has the issues which I mentioned earlier. My aim is to get to the
point where I can add or take away servers from the cluster without
impacting user experience. Ideally all state would be stored in a central
location (e.g. Redis). But, since this is difficult because of the way the
application is built I thought of using one server and only persisting the
sessions when the server goes down. But I still have to solve the issues I
mentioned.




On Tue, May 12, 2020 at 6:06 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Jonathan,
>
> On 5/12/20 05:51, Jonathan Yom-Tov wrote:
> > I have an application which changes the state of user sessions in
> > lots of places in the code. Is it possible to do a seamless switch
> > of Tomcat servers, preserving all sessions?
> >
> > I know I can use PersistentManager to persist sessions and load
> > them. I can think of two strategies:
> >
> > 1. Persist sessions periodically. This is more robust as I might
> > not have control of when the server shuts down. 2. Persist sessions
> > on server shutdown.
> >
> >
> > The problem with the first approach is that I might lose the latest
> > changes when the new server comes up. The problem with the second
> > is that I'll have to lock access to the session until the old
> > server is done saving it, which may make response times very slow.
> >
> > Is there a good solution to this that I might have overlooked?
>
> If you want to solve these problems:
>
> 1. Seamless (uninterrupted) restarts
> 2. Always up-to-date (well, as much as possible)
> 3. No downtime
>
> Then you really need a cluster where the sessions are being replicated
> around the cluster.
>
> This will solve some other problems as well:
>
> 4. Expected downtime (e.g. OS/Tomcat/application upgrade)
> 5. Unexpected downtime (network outage, hardware fault)
> 6. Scaling-out (either manually or automatically)
>
> You can do it with as little as two Tomcat instances. If you only care
> about being able to restart your application (and not the whole
> server, for example), then you can even run them side-by-side on the
> same server. You won't get protection against OS upgrades and
> unexpected downtime in that case, but you can get familiar with the
> setup without a whole lot of infrastructure.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl66rKgACgkQHPApP6U8
> pFjsChAAtKdo2Ow+X+Lb0JQLAOxijryxlsRtO3rvdRPJLUxVG4ttVGXuJ86cPX9g
> uRoyOrtgSw3N7mPMgL51B39Sp8GtB6zcjAiB4CQzOTXA3FiRN99Jna6dEVpCUcQx
> xAUBNuJh6Q5N/l1tpLYIMgKXEmhGcexplNTEVl8IAb5tppNy1LtjUVMG3C4NolI1
> eKUVqNhtSmclBH9aDC94jlWLVH+OiKJhAfc965oCRv4E3vIcj5HGoKfK65iqFYPx
> hzOMUzvJfsHBfNMo0UyKvRiDIFyBUgeUEIAJZWAJojhTSHymYpQozYBDIjCfNHYa
> II6NYhYb9OuiwV9PEXFN2yZejBsgJvZzlbooWOg2z4nMmCItaTiUhOMyKNIY5wlz
> iXnh85yx/GMRSsiQrTD6X4cAwCsXusHwoF/WC0JncYr7hZw/mqwcXDnMhUAccOCc
> Z1l2x53yoVSH+RyoGgdG/DSWqLHZfiK/xr8UOtRbMD1WNfGOPo+GhpJBiSNSBeeS
> LMNiQbvZEcTKOsxUFgUDPwB62kbDyLnt765tgrSOWubBIaHXBctTNLtv9sjp6ARG
> DnNTmAtdk89UuhDA63iimDxx9jxDKsWKPz8Srf6RS7z8yUrlvFkfKQcIEaqHSLTr
> LnbrTHK2k92bJonJua5hDcuTgU7axEBlWmXxChyZWmYm2r1R76M=
> =suSa
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 
[image: SysAid Technologies]
<http://www.sysaid.com/?utm_source=signature&utm_medium=email&utm_campaign=sysaid-logo>
Jonathan Yom-Tov
Senior Architect
jonathan.yom...@sysaid.com
Phone (IL): +972 (3) 533-3675 Ext. 932
[image: SysAid Technologies]
<https://www.sysaid.com/?utm_source=signature&utm_medium=email&utm_campaign=sysaid-logo-icon>
  [image: SysAid on Facebook] <https://www.facebook.com/SysAidIT>   [image:
SysAid on Twitter] <https://twitter.com/sysaid>   [image: SysAid on
Linked-in] <https://www.linkedin.com/company/sysaid-technologies-ltd>   [image:
SysAid on YouTube] <https://www.youtube.com/user/SysAidIT>   [image: SysAid
on Instagram] <https://www.instagram.com/sysaid_technologies/>
[image: Banner] <https://www.sysaid.com/sig-link>

Reply via email to