Re: Best practices for deployment on cluster environment
On 28/08/2010 11:18, Domenico Briganti wrote: Il giorno ven, 27/08/2010 alle 15.36 +0100, Pid ha scritto: If you're using mod_jk you can enable the /jk-manager worker (restricted to known IPs only, of course) and take the cluster member out of service at the proxy level before disabling the Tomcat. Thank Pid, Yes, I know that. But I have 24 Apache server and more than 200 worker configured. If I can, I prefer to not manage mod_jk too. I will let you know if my system works, So script it. You could use curl. p Domenco - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org 0x62590808.asc Description: application/pgp-keys signature.asc Description: OpenPGP digital signature
Re: Best practices for deployment on cluster environment
Hi, Our current system has two servers in a clustered environment with shared disk, but we ended up splitting the webapps areas into seperate. This gave us more control in the end and our promote procedure for a new version of an app is now scripted. So one server gets removed from the pool of active servers, upgraded and then replaced and the script moves to the next. We still need a full outage for things that require a schema change in the backend for example. But we do a sorry server page while the brief outage is underway. For a bigger site, you could go 2 clusters and have shared disk in each cluster. Pull one cluster at a time out of your load balancer and use the shared disk to trigger an upgrade. You'd have to pick a lull time in your load though so half the system could cope. It helps that half our system can carry the full load as we run a stretched cluster 150m apart for DR purposes. 150m isn't enough, but it's better than the same room. I've never played with the farm deployer module, not sure if thats an alternative. I'd be interested if anyone has? Or solved the problem another way. Hope that helps, Dave -- David Nillesen Systems Administrator http://njorsk.com On Thu, Aug 26, 2010 at 11:57 PM, Luca Gervasi tom...@ashetic.net wrote: On Wed, 2010-08-25 at 10:50 -0300, Fernando Morgenstern wrote: Hi, I have a Tomcat cluster environment with 4 servers. I was wondering that is the best way to deploy an application on 4 servers at the same time. At a first moment, i thought about having a script that would copy war files to all servers using rsync. Basically i upload the war file to the first server and them use this script to copy to other tomcat servers. Could you share your experience with this kind of environment? Is this the best way to deal with deployment? Thank you, Fernando M. Morgenstern - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org In such enviroment i think that you should deploy once in the NAS/SAN (i mean, unpack the war) and use the shared filesystem in ro in each istance. Btw i'm pretty interested in more answers :) See Ya - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Best practices for deployment on cluster environment
I've read many response to this thread, but when you redeploy in an enterprise environment (many httpd+mod_jk - 4 tomcat server - a db) independently if use shared or not appBase, manual or scripted deployer, with or without tomcat manager, you return to your client at 404 or worst a 503 when a request reach the tomcat. And for my application it's not permitted This is what I think I can do: Environment (24 Apache+mod_jk - 4 tomcat server) mod_jk with ping_mode=A and prepost_timeout=1000 to redeploy a wabapp: For each tomcat server: Connect to JMX MBean and stop AJP connector. Wait the end of all APJ RequestProcessor. Redeploy webapp with tomcat manager. Restart tomcat. Wait for 60 sec (The default maintenance of mod_jk). end. How about this? Regards, Domenico - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Best practices for deployment on cluster environment
On 27/08/2010 12:21, Domenico Briganti wrote: I've read many response to this thread, but when you redeploy in an enterprise environment (many httpd+mod_jk - 4 tomcat server - a db) independently if use shared or not appBase, manual or scripted deployer, with or without tomcat manager, you return to your client at 404 or worst a 503 when a request reach the tomcat. And for my application it's not permitted This is what I think I can do: Environment (24 Apache+mod_jk - 4 tomcat server) mod_jk with ping_mode=A and prepost_timeout=1000 to redeploy a wabapp: For each tomcat server: Connect to JMX MBean and stop AJP connector. Wait the end of all APJ RequestProcessor. Redeploy webapp with tomcat manager. Restart tomcat. Wait for 60 sec (The default maintenance of mod_jk). end. How about this? If you're using mod_jk you can enable the /jk-manager worker (restricted to known IPs only, of course) and take the cluster member out of service at the proxy level before disabling the Tomcat. You'll have no downtime and won't drop any connections that way. p Regards, Domenico - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org 0x62590808.asc Description: application/pgp-keys signature.asc Description: OpenPGP digital signature
Re: Best practices for deployment on cluster environment
On Wed, 2010-08-25 at 10:50 -0300, Fernando Morgenstern wrote: Hi, I have a Tomcat cluster environment with 4 servers. I was wondering that is the best way to deploy an application on 4 servers at the same time. At a first moment, i thought about having a script that would copy war files to all servers using rsync. Basically i upload the war file to the first server and them use this script to copy to other tomcat servers. Could you share your experience with this kind of environment? Is this the best way to deal with deployment? Thank you, Fernando M. Morgenstern - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org In such enviroment i think that you should deploy once in the NAS/SAN (i mean, unpack the war) and use the shared filesystem in ro in each istance. Btw i'm pretty interested in more answers :) See Ya - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Best practices for deployment on cluster environment
Luca Gervasi wrote: On Wed, 2010-08-25 at 10:50 -0300, Fernando Morgenstern wrote: Hi, I have a Tomcat cluster environment with 4 servers. I was wondering that is the best way to deploy an application on 4 servers at the same time. At a first moment, i thought about having a script that would copy war files to all servers using rsync. Basically i upload the war file to the first server and them use this script to copy to other tomcat servers. Could you share your experience with this kind of environment? Is this the best way to deal with deployment? Thank you, Fernando M. Morgenstern - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org In such enviroment i think that you should deploy once in the NAS/SAN (i mean, unpack the war) and use the shared filesystem in ro in each istance. Btw i'm pretty interested in more answers :) And I believe that this is bad advice (but I am also willing to be contradicted). Suppose you do this, and one Tomcat notices and starts redeploying the application. What about the other ones which are in the process of serving requests, and would suddenly find a missing or changed servlet under their nose ? At least, you would need some kind of mechanism to tell all Tomcats : wait a minute, do not process any more requests to this application while it is being redeployed, no ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Best practices for deployment on cluster environment
Hi, I think the best way is to share a central repository (local or net mounted) for webapps and create for each one and for each tomcat the right context with the right path. regards On 26 August 2010 16:03, André Warnier a...@ice-sa.com wrote: Luca Gervasi wrote: On Wed, 2010-08-25 at 10:50 -0300, Fernando Morgenstern wrote: Hi, I have a Tomcat cluster environment with 4 servers. I was wondering that is the best way to deploy an application on 4 servers at the same time. At a first moment, i thought about having a script that would copy war files to all servers using rsync. Basically i upload the war file to the first server and them use this script to copy to other tomcat servers. Could you share your experience with this kind of environment? Is this the best way to deal with deployment? Thank you, Fernando M. Morgenstern - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org In such enviroment i think that you should deploy once in the NAS/SAN (i mean, unpack the war) and use the shared filesystem in ro in each istance. Btw i'm pretty interested in more answers :) And I believe that this is bad advice (but I am also willing to be contradicted). Suppose you do this, and one Tomcat notices and starts redeploying the application. What about the other ones which are in the process of serving requests, and would suddenly find a missing or changed servlet under their nose ? At least, you would need some kind of mechanism to tell all Tomcats : wait a minute, do not process any more requests to this application while it is being redeployed, no ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Best practices for deployment on cluster environment
On 26/08/2010 15:03, André Warnier wrote: Luca Gervasi wrote: On Wed, 2010-08-25 at 10:50 -0300, Fernando Morgenstern wrote: Hi, I have a Tomcat cluster environment with 4 servers. I was wondering that is the best way to deploy an application on 4 servers at the same time. At a first moment, i thought about having a script that would copy war files to all servers using rsync. Basically i upload the war file to the first server and them use this script to copy to other tomcat servers. Could you share your experience with this kind of environment? Is this the best way to deal with deployment? Thank you, Fernando M. Morgenstern - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org In such enviroment i think that you should deploy once in the NAS/SAN (i mean, unpack the war) and use the shared filesystem in ro in each istance. Btw i'm pretty interested in more answers :) And I believe that this is bad advice (but I am also willing to be contradicted). Nope. You're right, it's a really bad idea. Hosts, let alone servers, should not share an appBase. p Suppose you do this, and one Tomcat notices and starts redeploying the application. What about the other ones which are in the process of serving requests, and would suddenly find a missing or changed servlet under their nose ? At least, you would need some kind of mechanism to tell all Tomcats : wait a minute, do not process any more requests to this application while it is being redeployed, no ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org 0x62590808.asc Description: application/pgp-keys signature.asc Description: OpenPGP digital signature
Re: Best practices for deployment on cluster environment
An ant deploy perhaps? Through the manager thats what we intend to move to. On Thu, Aug 26, 2010 at 4:17 PM, Pid p...@pidster.com wrote: On 26/08/2010 15:03, André Warnier wrote: Luca Gervasi wrote: On Wed, 2010-08-25 at 10:50 -0300, Fernando Morgenstern wrote: Hi, I have a Tomcat cluster environment with 4 servers. I was wondering that is the best way to deploy an application on 4 servers at the same time. At a first moment, i thought about having a script that would copy war files to all servers using rsync. Basically i upload the war file to the first server and them use this script to copy to other tomcat servers. Could you share your experience with this kind of environment? Is this the best way to deal with deployment? Thank you, Fernando M. Morgenstern - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org In such enviroment i think that you should deploy once in the NAS/SAN (i mean, unpack the war) and use the shared filesystem in ro in each istance. Btw i'm pretty interested in more answers :) And I believe that this is bad advice (but I am also willing to be contradicted). Nope. You're right, it's a really bad idea. Hosts, let alone servers, should not share an appBase. p Suppose you do this, and one Tomcat notices and starts redeploying the application. What about the other ones which are in the process of serving requests, and would suddenly find a missing or changed servlet under their nose ? At least, you would need some kind of mechanism to tell all Tomcats : wait a minute, do not process any more requests to this application while it is being redeployed, no ? - 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: Best practices for deployment on cluster environment
On 25/08/2010 14:50, Fernando Morgenstern wrote: Hi, I have a Tomcat cluster environment with 4 servers. I was wondering that is the best way to deploy an application on 4 servers at the same time. At a first moment, i thought about having a script that would copy war files to all servers using rsync. Basically i upload the war file to the first server and them use this script to copy to other tomcat servers. Could you share your experience with this kind of environment? Is this the best way to deal with deployment? Scripting your deployment process is a Good Idea. It will also mean that it happens the same every time, according to whatever your scripted procedure is. Upload them separately to each server, check integrity and then run a local script to finish the process and deploy them to appBase do server restarts if needed. If you're deploying to production servers with auto-deployment enabled, make sure the upload occurs to a separate temp location, before copying it into the appBase. You could SCP files up to a location on the server, using a user account configured with a password-free key pair. SSH will let you limit a given key to specific commands, so the account could be configured solely for uploading the files then running the local deployment script. p 0x62590808.asc Description: application/pgp-keys signature.asc Description: OpenPGP digital signature
Re: Best practices for deployment on cluster environment
I haven't tried this in production (yet) so your mileage may vary. In the cluster setup, there's a FarmDeployer element that can be used to deploy across the cluster. The host that does the deploying: Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer tempDir=${catalina.base}/temp-dir/ deployDir=${catalina.base}/webapps/ watchDir=${catalina.base}/watch-dir/ processDeployFrequency=4 watchEnabled=true/ And the hosts that get the web application: Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer tempDir=${catalina.base}/temp-dir/ deployDir=${catalina.base}/webapps/ watchDir=${catalina.base}/watch-dir/ processDeployFrequency=4 watchEnabled=false/ For large web applications and frequent deployments, this might generate a lot of network traffic. Also, it's not intuitive (to me) how processDeployFrequency works, but I need to look at the code. In any case, you might have the Tomcat doing the deploying not actually serving content. I found out that you can use ${variable.name} in configuration files, so it's now much easier to clone installations and just edit setenv.sh(bat) as appropriate. Hope this helps. . . . just my two cents. /mde/ - Original Message From: Pid p...@pidster.com To: Tomcat Users List users@tomcat.apache.org Sent: Thu, August 26, 2010 7:36:15 AM Subject: Re: Best practices for deployment on cluster environment On 25/08/2010 14:50, Fernando Morgenstern wrote: Hi, I have a Tomcat cluster environment with 4 servers. I was wondering that is the best way to deploy an application on 4 servers at the same time. At a first moment, i thought about having a script that would copy war files to all servers using rsync. Basically i upload the war file to the first server and them use this script to copy to other tomcat servers. Could you share your experience with this kind of environment? Is this the best way to deal with deployment? Scripting your deployment process is a Good Idea. It will also mean that it happens the same every time, according to whatever your scripted procedure is. Upload them separately to each server, check integrity and then run a local script to finish the process and deploy them to appBase do server restarts if needed. If you're deploying to production servers with auto-deployment enabled, make sure the upload occurs to a separate temp location, before copying it into the appBase. You could SCP files up to a location on the server, using a user account configured with a password-free key pair. SSH will let you limit a given key to specific commands, so the account could be configured solely for uploading the files then running the local deployment script. p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Best practices for deployment on cluster environment
On 26/08/2010 19:14, Mark Eggers wrote: I haven't tried this in production (yet) so your mileage may vary. In the cluster setup, there's a FarmDeployer element that can be used to deploy across the cluster. FarmWarDeployer would certainly benefit from more production usage. I'm not sure the reverse is true. p The host that does the deploying: Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer tempDir=${catalina.base}/temp-dir/ deployDir=${catalina.base}/webapps/ watchDir=${catalina.base}/watch-dir/ processDeployFrequency=4 watchEnabled=true/ And the hosts that get the web application: Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer tempDir=${catalina.base}/temp-dir/ deployDir=${catalina.base}/webapps/ watchDir=${catalina.base}/watch-dir/ processDeployFrequency=4 watchEnabled=false/ For large web applications and frequent deployments, this might generate a lot of network traffic. Also, it's not intuitive (to me) how processDeployFrequency works, but I need to look at the code. In any case, you might have the Tomcat doing the deploying not actually serving content. I found out that you can use ${variable.name} in configuration files, so it's now much easier to clone installations and just edit setenv.sh(bat) as appropriate. Hope this helps. . . . just my two cents. /mde/ - Original Message From: Pid p...@pidster.com To: Tomcat Users List users@tomcat.apache.org Sent: Thu, August 26, 2010 7:36:15 AM Subject: Re: Best practices for deployment on cluster environment On 25/08/2010 14:50, Fernando Morgenstern wrote: Hi, I have a Tomcat cluster environment with 4 servers. I was wondering that is the best way to deploy an application on 4 servers at the same time. At a first moment, i thought about having a script that would copy war files to all servers using rsync. Basically i upload the war file to the first server and them use this script to copy to other tomcat servers. Could you share your experience with this kind of environment? Is this the best way to deal with deployment? Scripting your deployment process is a Good Idea. It will also mean that it happens the same every time, according to whatever your scripted procedure is. Upload them separately to each server, check integrity and then run a local script to finish the process and deploy them to appBase do server restarts if needed. If you're deploying to production servers with auto-deployment enabled, make sure the upload occurs to a separate temp location, before copying it into the appBase. You could SCP files up to a location on the server, using a user account configured with a password-free key pair. SSH will let you limit a given key to specific commands, so the account could be configured solely for uploading the files then running the local deployment script. p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org 0x62590808.asc Description: application/pgp-keys signature.asc Description: OpenPGP digital signature
Best practices for deployment on cluster environment
Hi, I have a Tomcat cluster environment with 4 servers. I was wondering that is the best way to deploy an application on 4 servers at the same time. At a first moment, i thought about having a script that would copy war files to all servers using rsync. Basically i upload the war file to the first server and them use this script to copy to other tomcat servers. Could you share your experience with this kind of environment? Is this the best way to deal with deployment? Thank you, Fernando M. Morgenstern - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org