[chef] Re: Re: Re: Re: Re: Deploying .war files?


Chronological Thread 
  • From: KC Braunschweig < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Re: Deploying .war files?
  • Date: Tue, 21 Jun 2011 10:57:25 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=L/TOOdCWaBh7WUmURr6RMuyqv3h11kjZ/F8wGxEDKW1azNdyfkxHqDWRwZKE483OTf uoKI3/JWn/M2plAiwc0etpmRHzneOtcu2UMoTfeqEp2SEj94yqUX5wwj9QK2c8kWM+C2 XHb6O39JgSgjvc0boDnUc5Ld1PbPY2oeyhzNc=

A couple other thoughts for you:

- We do this by keeping builds as maven (http://maven.apache.org/)
artifacts in a nexus repository (http://nexus.sonatype.org/) and
deploy with a custom artifact deployer cookbook. With nexus you have a
nice API you can use to determine the right build to deploy and
compare to what was deployed. Although we haven't released that
cookbook yet, if you're having issues, I'll prod my teammate that
wrote it to help you.

- Keep in mind if you end up doing live deployments (i.e. don't
restart tomcat) you may run into memory issues. I've had problems with
pretty much every java container trying to do live deploys. Basically
the JVM leaks memory and eventually you hang the JVM. Since the
failure happens indeterminately, I decided better to deal with
restarts and have a repeatable process then to attempt a live deploy
that may fail randomly, if infrequently. However, I've heard tomcat 7
tries to work around this issues and maybe its better?

KC

On Tue, Jun 21, 2011 at 4:44 AM, Matthew Drobnak
< >
 wrote:
> I appreciate everyone's input so far.
> Seth, I totally missed the application cookbook. I'll look into that and
> hopefully can get at least 1 piece running with Chef!
> I love the premise, but all of the configuration management systems seem to
> have a bit of a steep climb before it becomes easy and powerful. :)
> Thanks again.
> -Matt
>
> On Jun 21, 2011, at 12:10 AM, Seth Chisamore wrote:
>
> The java_webapp recipe in the application cookbook [0][1] was created to
> accomplish just this task!
> The Java Quick Start [1] has a full working example of using this recipe to
> deploy a Java webapp, including setting up an environment
> specific context.xml with database connection information.
> Seth
> --
> Opscode, Inc.
> Seth Chisamore, Senior Technical Evangelist
> IRC, Skype, Twitter, Github: schisamo
> [0] http://community.opscode.com/cookbooks/application
> [1] https://github.com/opscode/cookbooks/blob/master/application/README.md
> [2] http://help.opscode.com/kb/otherhelp/build-a-java-web-stack
>
>
> On Mon, Jun 20, 2011 at 11:35 PM, Ken Mazaika 
> < >
>  wrote:
>>
>> could you use something like capistrano for java?
>>
>> On Mon, Jun 20, 2011 at 11:32 PM, Edward Sargisson 
>> < >
>> wrote:
>>>
>>> I need to do the same thing but haven't written it yet. Here's my plan
>>> - hopefully others can critique.
>>>
>>> Firstly, you don't want to stop tomcat. Chef runs every 20 minutes or
>>> so (or whenever you set it for) so it would stop your server every 20
>>> minutes. Instead, you should work out if the file on your file server
>>> has changed and then do the update. In my case, my build artifacts
>>> have a build id. I plan to store the desired build id in a data bag *.
>>> The deployed data bag goes into the node data. Then, on the chef run
>>> it can compare and then run the update if required.
>>>
>>> When you do the update you don't need to stop tomcat. Instead you
>>> download the WAR to a temp directory then go to the webapps dir and
>>> delete the directory for your webapp as well as the old WAR. Then you
>>> copy the WAR in. (You can't download directly because then Tomcat
>>> un-jars it before it's downloaded). Tomcat then un-jars it and starts
>>> it up for you.
>>>
>>> Cheers,
>>> Edward
>>>
>>> * Amusingly, I forgot the name for data bag and my mind came up with
>>> drop bag. Once a trail runner, always a trail runner... :-)
>>>
>>> On Mon, Jun 20, 2011 at 8:25 PM,  
>>> < >
>>>  wrote:
>>> > Hi everyone,
>>> > I'm fairly new to Chef. I downloaded and deployed the tomcat cookbook
>>> > to a
>>> > node, and now I'm trying to add a recipe? or another cookbook, I'm not
>>> > sure
>>> > really...to deploy our web app that should run on Tomcat.
>>> >
>>> > I basically want the node to stop tomcat, delete everything in the
>>> > webapps
>>> > directory, and scp a file to the right spot..then start tomcat.
>>> >
>>> > I looked briefly at the deploy resource, but that's from a version
>>> > control
>>> > system...we don't keep builds in version control, only the source..the
>>> > binary
>>> > builds are on a server, so I don't think that's what I want.
>>> >
>>> > If anyone can point me in the right direction to get this going, that
>>> > would be
>>> > greatly appreciated.
>>> >
>>> > Thanks.
>>> >
>>> > -Matt
>>> >
>>
>
>
>



Archive powered by MHonArc 2.6.16.

§