- From: Matthew Drobnak <
>
- To: "
" <
>
- Subject: [chef] RE: Re: RE: Re: Re: Re: Re: Deploying .war files?
- Date: Thu, 23 Jun 2011 11:04:02 -0400
- Accept-language: en-US
- Acceptlanguage: en-US
Seth,
Thanks for the response.
I did figure out the data bag item issue shortly after...at which point I
tried to create a node and manually specify fqdn and ip address, since it's
SQL Server, production, and not ready to install chef on quite yet. ;)
At that point, when I tried updating the client definition...I killed my
server. The node list never returned. It could be I tried editing it in the
Web UI between exporting the client as json and re-importing it...
So I learned a lesson: Don't mess with nodes manually, LOL. What should I do
in this situation? Is installing the Chef client the only way around it, or
should I modify the recipe to take an override from json?
I'm going to look at the mods made by Haselwanter Edmund to see if that gets
me what I need.
-Matt
-----Original Message-----
From: Seth Chisamore
[mailto:
Sent: Thursday, June 23, 2011 10:59 AM
To:
Subject: [chef] Re: RE: Re: Re: Re: Re: Deploying .war files?
Matt,
The context.xml should have been created as
"/srv/spark_server/shared/AppName.xml" [0], but that will only happen if a
database master is found in the search [1]. This file is then symlinked over
[2] into the tomcat context dir. It appears you are missing the
'database_master_role' value in your data bag item, this would cause the
search to return no results.
Right now the application::java_webapp recipe only supports deploying wars
into the root of the container. Mostly because in our initial customer use
cases they were deploying single apps into smaller horizontally scaled app
servers. Deploying into the root context makes automating the configuration
of the load balancing layer much easier.
Seth
--
Opscode, Inc.
Seth Chisamore, Senior Technical Evangelist
IRC, Skype, Twitter, Github: schisamo
[0]
https://github.com/opscode/cookbooks/blob/master/application/recipes/java_webapp.rb#L87
[1]
https://github.com/opscode/cookbooks/blob/master/application/recipes/java_webapp.rb#L78
[2]
https://github.com/opscode/cookbooks/blob/master/application/recipes/tomcat.rb#L31
On Wednesday, June 22, 2011 at 2:11 PM, Matthew Drobnak wrote:
>
Ok, so I did the following:
>
>
Created a role called spark_server:
>
>
{
>
"name": "spark_server",
>
"default_attributes": {
>
},
>
"json_class": "Chef::Role",
>
"env_run_lists": {
>
},
>
"run_list": [
>
"recipe[application]"
>
],
>
"description": "Spark Tomcat Server",
>
"chef_type": "role",
>
"override_attributes": {
>
}
>
}
>
>
Created data bag apps:
>
>
{
>
"group": "nogroup",
>
"server_roles": [
>
"spark_server"
>
],
>
"databases": {
>
"_default": {
>
"max_active": "100",
>
"port": "1433",
>
"username": "user",
>
"adapter": "sqlserver",
>
"max_idle": "30",
>
"database": "appname",
>
"driver": "com.microsoft.sqlserver.jdbc.SQLServerDriver",
>
"max_wait": "10000",
>
"password": "awesome_password"
>
},
>
"dev": {
>
"max_active": "100",
>
"port": "1433",
>
"username": "user",
>
"adapter": "sqlserver",
>
"max_idle": "30",
>
"database": "appname",
>
"driver": "com.microsoft.sqlserver.jdbc.SQLServerDriver",
>
"max_wait": "10000",
>
"password": "apppass"
>
}
>
},
>
"id": "AppName",
>
"mysql_repl_password": {
>
"_default": "mysql_repl"
>
},
>
"type": {
>
"spark_server": [
>
"java_webapp",
>
"tomcat"
>
]
>
},
>
"war": {
>
"_default": {
>
"checksum":
>
"06880edebbf24c4000da4d45d26aa97ddc2a6ad1ae3e4365c755fdb5a1ad481a",
>
"source": "http://redacted/spark_server.war"
>
}
>
},
>
"mysql_root_password": {
>
"_default": "mysql_root"
>
},
>
"mysql_debian_password": {
>
"_default": "mysql_debian"
>
},
>
"deploy_to": "/srv/spark_server",
>
"owner": "nobody"
>
}
>
>
These are the cookbooks I have installed:
>
>
apache2 0.99.4
>
application 0.99.11
>
apt 1.1.2
>
build-essential 1.0.0
>
chef-client 0.99.5
>
gunicorn 1.0.0
>
java 1.1.0
>
jpackage 0.10.0
>
mysql 1.0.6
>
openssl 1.0.0
>
passenger_apache2 0.99.0
>
php 1.0.0
>
python 1.0.2
>
runit 0.14.2
>
tomcat 0.10.3
>
unicorn 1.0.0
>
xml 1.0.0
>
>
>
So at this point:
>
I have a node, with Tomcat installed. But, I have
>
/srv/spark_sever/releases/<sha256sum>.war plus a shared/logs,
>
shared/pids,shared/system directories which are empty.
>
/etc/tomcat6/Catalina/localhost/ROOT.xml points to
>
/srv/spark_server/shared/AppName.xml, which does not exist.
>
/var/lib/tomcat6/webapps is empty (ROOT was deleted by the java_webapp
>
recipe…), so there’s nothing actually running.
>
>
So two things:
>
What happened to my context.xml file?
>
How can I deploy to a named context instead of the ROOT context?
>
>
Thanks.
>
>
-Matt
>
>
>
From: Matthew Drobnak
>
[mailto:
>
>
Sent: Tuesday, June 21, 2011 7:45 AM
>
To:
>
>
>
(mailto:
)
>
Subject: [chef] Re: Re: Re: Re: Deploying .war files?
>
>
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
>
> <
>
>
>
> (mailto:
)>
>
> wrote:
>
> could you use something like capistrano for java?
>
>
>
>
>
>
>
> On Mon, Jun 20, 2011 at 11:32 PM, Edward Sargisson
>
> <
>
>
>
> (mailto:
)>
>
> 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,
>
> <
>
>
>
> (mailto:
)>
>
> 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.