RE: Sharing catalina home among tomcat machines in a load balanced environment gives problems with log files
Dream * Excel * Explore * Inspire Jon McAlexander Senior Infrastructure Engineer Asst. Vice President He/His Middleware Product Engineering Enterprise CIO | EAS | Middleware | Infrastructure Solutions 8080 Cobblestone Rd | Urbandale, IA 50322 MAC: F4469-010 Tel 515-988-2508 | Cell 515-988-2508 jonmcalexan...@wellsfargo.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > -Original Message- > From: Christopher Schultz > Sent: Thursday, October 12, 2023 8:31 AM > To: users@tomcat.apache.org > Subject: Re: Sharing catalina home among tomcat machines in a load > balanced environment gives problems with log files > > Jon, > > On 10/10/23 14:26, Mcalexander, Jon J. wrote: > > Could you have separate work folders but have the appbase be the in > > the shared folder space? > You could do this with some symlinking, but I wouldn't recommend it. If you > start to do things like dynamic deployment, etc. you will find that both > servers will be affected and that may not be what you want. > > Automation is very flexible and disk space is cheap. Do yourself a favor and > just separate things so you don't have unforeseen problems. > > -chris > > >> -Original Message- > >> From: Christopher Schultz > >> Sent: Tuesday, October 10, 2023 5:59 AM > >> To: users@tomcat.apache.org > >> Subject: Re: Sharing catalina home among tomcat machines in a load > >> balanced environment gives problems with log files > >> > >> Mark, > >> > >> On 10/10/23 06:38, Mark Thomas wrote: > >>> Running multiple instances of Tomcat from the same CATALINA_BASE is > >>> totally unsupported. This isn't one of those "We don't technically > >>> support that but you should be OK situations". This is one of the > >>> rare "You do that and it *will* break and you will be on your own > >>> when it does." situations. > >> > >> +1 > >> > >> Both the logs/ and the work/ directories will overwrite each other, > >> probably to the point of not only corruption (e.g. log files) but > >> also instability -- because of the work/ directory. Files will appear > >> and disappear surprisingly to one or the other running Tomcat and you > WILL have errors, etc. > >> > >>> On 10/10/2023 06:51, Giuseppe Sacco wrote: > >> >> > >>>> I did not use different CATALINA_BASE and CATALINA_HOME since this > >>>> would have required to deploy all applications on two different > >>>> tomcats > >> > >> In this case, *you have two different Tomcats*, so it is appropriate > >> to use different CATALINA_BASE paths. > >> > >>>> and my > >>>> pipeline only allows to deploy to one tomcat putting an XML file in > >>>> $CATALINA_BASE/conf/Catalina/localhost directory. > >> > >> Maybe you can use a symlink from both directories? > >> > >> -chris > >> > >> - > >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > >> For additional commands, e-mail: users-h...@tomcat.apache.org > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > > For additional commands, e-mail: users-h...@tomcat.apache.org > > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Sharing catalina home among tomcat machines in a load balanced environment gives problems with log files
Jon, On 10/10/23 14:26, Mcalexander, Jon J. wrote: Could you have separate work folders but have the appbase be the in the shared folder space? You could do this with some symlinking, but I wouldn't recommend it. If you start to do things like dynamic deployment, etc. you will find that both servers will be affected and that may not be what you want. Automation is very flexible and disk space is cheap. Do yourself a favor and just separate things so you don't have unforeseen problems. -chris -Original Message- From: Christopher Schultz Sent: Tuesday, October 10, 2023 5:59 AM To: users@tomcat.apache.org Subject: Re: Sharing catalina home among tomcat machines in a load balanced environment gives problems with log files Mark, On 10/10/23 06:38, Mark Thomas wrote: Running multiple instances of Tomcat from the same CATALINA_BASE is totally unsupported. This isn't one of those "We don't technically support that but you should be OK situations". This is one of the rare "You do that and it *will* break and you will be on your own when it does." situations. +1 Both the logs/ and the work/ directories will overwrite each other, probably to the point of not only corruption (e.g. log files) but also instability -- because of the work/ directory. Files will appear and disappear surprisingly to one or the other running Tomcat and you WILL have errors, etc. On 10/10/2023 06:51, Giuseppe Sacco wrote: >> I did not use different CATALINA_BASE and CATALINA_HOME since this would have required to deploy all applications on two different tomcats In this case, *you have two different Tomcats*, so it is appropriate to use different CATALINA_BASE paths. and my pipeline only allows to deploy to one tomcat putting an XML file in $CATALINA_BASE/conf/Catalina/localhost directory. Maybe you can use a symlink from both directories? -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Sharing catalina home among tomcat machines in a load balanced environment gives problems with log files
Could you have separate work folders but have the appbase be the in the shared folder space? Dream * Excel * Explore * Inspire Jon McAlexander Senior Infrastructure Engineer Asst. Vice President He/His Middleware Product Engineering Enterprise CIO | EAS | Middleware | Infrastructure Solutions 8080 Cobblestone Rd | Urbandale, IA 50322 MAC: F4469-010 Tel 515-988-2508 | Cell 515-988-2508 jonmcalexan...@wellsfargo.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > -Original Message- > From: Christopher Schultz > Sent: Tuesday, October 10, 2023 5:59 AM > To: users@tomcat.apache.org > Subject: Re: Sharing catalina home among tomcat machines in a load > balanced environment gives problems with log files > > Mark, > > On 10/10/23 06:38, Mark Thomas wrote: > > Running multiple instances of Tomcat from the same CATALINA_BASE is > > totally unsupported. This isn't one of those "We don't technically > > support that but you should be OK situations". This is one of the rare > > "You do that and it *will* break and you will be on your own when it > > does." situations. > > +1 > > Both the logs/ and the work/ directories will overwrite each other, probably > to the point of not only corruption (e.g. log files) but also instability -- > because of the work/ directory. Files will appear and disappear surprisingly > to > one or the other running Tomcat and you WILL have errors, etc. > > > On 10/10/2023 06:51, Giuseppe Sacco wrote: > >> > >> I did not use different CATALINA_BASE and CATALINA_HOME since this > >> would have required to deploy all applications on two different > >> tomcats > > In this case, *you have two different Tomcats*, so it is appropriate to use > different CATALINA_BASE paths. > > >> and my > >> pipeline only allows to deploy to one tomcat putting an XML file in > >> $CATALINA_BASE/conf/Catalina/localhost directory. > > Maybe you can use a symlink from both directories? > > -chris > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Sharing catalina home among tomcat machines in a load balanced environment gives problems with log files
Hello, Il giorno mar, 10/10/2023 alle 06.59 -0400, Christopher Schultz ha scritto: > Mark, > > On 10/10/23 06:38, Mark Thomas wrote: > > Running multiple instances of Tomcat from the same CATALINA_BASE is > > totally unsupported. This isn't one of those "We don't technically > > support that but you should be OK situations". This is one of the rare > > "You do that and it *will* break and you will be on your own when it > > does." situations. > > +1 > > Both the logs/ and the work/ directories will overwrite each other, > probably to the point of not only corruption (e.g. log files) but also > instability -- because of the work/ directory. Files will appear and > disappear surprisingly to one or the other running Tomcat and you WILL > have errors, etc. Thank you very much to all. I am going to use two CATALINA_BASE and I'll try to change the pipeline we use for deploy. Bye, Giuseppe - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Sharing catalina home among tomcat machines in a load balanced environment gives problems with log files
Mark, On 10/10/23 06:38, Mark Thomas wrote: Running multiple instances of Tomcat from the same CATALINA_BASE is totally unsupported. This isn't one of those "We don't technically support that but you should be OK situations". This is one of the rare "You do that and it *will* break and you will be on your own when it does." situations. +1 Both the logs/ and the work/ directories will overwrite each other, probably to the point of not only corruption (e.g. log files) but also instability -- because of the work/ directory. Files will appear and disappear surprisingly to one or the other running Tomcat and you WILL have errors, etc. On 10/10/2023 06:51, Giuseppe Sacco wrote: >> I did not use different CATALINA_BASE and CATALINA_HOME since this would have required to deploy all applications on two different tomcats In this case, *you have two different Tomcats*, so it is appropriate to use different CATALINA_BASE paths. and my pipeline only allows to deploy to one tomcat putting an XML file in $CATALINA_BASE/conf/Catalina/localhost directory. Maybe you can use a symlink from both directories? -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Sharing catalina home among tomcat machines in a load balanced environment gives problems with log files
Running multiple instances of Tomcat from the same CATALINA_BASE is totally unsupported. This isn't one of those "We don't technically support that but you should be OK situations". This is one of the rare "You do that and it *will* break and you will be on your own when it does." situations. Mark On 10/10/2023 06:51, Giuseppe Sacco wrote: Hello Peter, Il giorno mar, 10/10/2023 alle 11.21 +0200, l...@kreuser.name ha scritto: Guiseppe, did you consider the separation of CATALINA_HOME and CATALINA_BASE. Look at the RUNNING.txt file that describes the purpose... Plus some symbolic links that have the really common files linked to the BASE directory? I did not use different CATALINA_BASE and CATALINA_HOME since this would have required to deploy all applications on two different tomcats and my pipeline only allows to deploy to one tomcat putting an XML file in $CATALINA_BASE/conf/Catalina/localhost directory. Thank you, Giuseppe - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Sharing catalina home among tomcat machines in a load balanced environment gives problems with log files
Hello Peter, Il giorno mar, 10/10/2023 alle 11.21 +0200, l...@kreuser.name ha scritto: > Guiseppe, > > did you consider the separation of CATALINA_HOME and CATALINA_BASE. Look > at the RUNNING.txt file that describes the purpose... > > Plus some symbolic links that have the really common files linked to the > BASE directory? I did not use different CATALINA_BASE and CATALINA_HOME since this would have required to deploy all applications on two different tomcats and my pipeline only allows to deploy to one tomcat putting an XML file in $CATALINA_BASE/conf/Catalina/localhost directory. Thank you, Giuseppe - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Sharing catalina home among tomcat machines in a load balanced environment gives problems with log files
Guiseppe, did you consider the separation of CATALINA_HOME and CATALINA_BASE. Look at the RUNNING.txt file that describes the purpose... Plus some symbolic links that have the really common files linked to the BASE directory? HTH Peter Am 10.10.2023 um 09:53 schrieb Giuseppe Sacco : Hello, I am testing an environment with a load balancer and two machines that host tomcat. The two machines should really be identical, and no tomcat cluster is configured (no sessions are shared between the tomcats). I would like to put the tomcat installation (catalina_home) in a shared directory and have both tomcat use it. In a test installation I only have some problems with log files, since they are shared and the tomcats write concurrently to the same files, overlapping their text. I set the property java.util.logging.config.file to a per tomcat properties file, and this works for some of the files, but not for all. In fact, at least the AccessLogValve does not have any way to specify a different directory for each host, i.e., adding the hostname in the path. So, these are my questions: is this way of sharing tomcat_home a viable solution? Are there any way to store all log files in separate directories based on the hostname or the ip address or a java parameter (using -D... on the command line)? Is there a way to change log locking/buffering in a way that written text does not overlap when two tomcats write concurrently? Thank you, Giuseppe - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Sharing catalina home among tomcat machines in a load balanced environment gives problems with log files
Hello, I am testing an environment with a load balancer and two machines that host tomcat. The two machines should really be identical, and no tomcat cluster is configured (no sessions are shared between the tomcats). I would like to put the tomcat installation (catalina_home) in a shared directory and have both tomcat use it. In a test installation I only have some problems with log files, since they are shared and the tomcats write concurrently to the same files, overlapping their text. I set the property java.util.logging.config.file to a per tomcat properties file, and this works for some of the files, but not for all. In fact, at least the AccessLogValve does not have any way to specify a different directory for each host, i.e., adding the hostname in the path. So, these are my questions: is this way of sharing tomcat_home a viable solution? Are there any way to store all log files in separate directories based on the hostname or the ip address or a java parameter (using -D... on the command line)? Is there a way to change log locking/buffering in a way that written text does not overlap when two tomcats write concurrently? Thank you, Giuseppe - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org