[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Application management
From: |
Wheeler, John |
Subject: |
RE: Application management |
Date: |
Mon, 24 Mar 2003 15:50:16 -0600 |
Paul,
This question gets asked a lot. There have been many solutions submitted
with varying complexity. Read this thread to get an Idea of what some
have done:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=mail
man.536.1040617267.19936.help-cfengine%40gnu.org&rnum=1&prev=/groups%3Fq
%3Dinstall%2Bsoftware%2Bgroup:gnu.cfengine.help%26hl%3Den%26lr%3D%26ie%3
DUTF-8%26oe%3DUTF-8%26selm%3Dmailman.536.1040617267.19936.help-cfengine%
2540gnu.org%26rnum%3D1
If the link doesn't work it's a post originating from Luke Kanies on Dec
21.
Not sure if this thread contains it or not, but also some interesting
reads on ISconf http://www.isconf.org/ and template tree
http://isg.ee.ethz.ch/tools/tetre2/. Although they sound like
interesting tools, at this point I've chosen not to implement a cross
breed solution. Finally, I think there are a few papers published on
utilizing a database and the rpm format for all package management.
-undo - I think some of the tools I mention above my do a better job of
state mgmt. I personally don't try to "undo", but I don't have a good
alternative (brute force).
I'll also addressing the application management aspect of things. Its in
its infancy right now but here's what I have to deploy a webapp to an
app server.
[root@meriadoc]:> more registerDeploy.conf
control:
actionsequence = (
shellcommands.registerDeploy
)
CVSTAGFILES = ( sysops/sites/register/qa/cvstagfiles )
# The cvstagfiles are the files I pull from cvs to do this deploy
REGISTER_TAG = ( deploy_register_03202003 )
# this is the tag I use for checkout
shellcommands:
registerDeploy::
# Get the file that indicates the files needed for this
deploy
'/bin/su - deploy -c "cvs checkout -r $(REGISTER_TAG)
${CVSTAGFILES}"'
# the "deploy" user is a limited access cvs user ( host access as well
as cvs tree)
# Get the file from cvs indicated from the file above
'/bin/su - deploy -c "awk
$(quote){print\${dollar}7}$(quote) ${CVSTAGFILES}|xargs cvs checkout -r
${REGISTER_TAG}'
# nasty ugly but works get the 7th field from the map above and checkout
the file
import:
# currently on doing app code update
registerAppDeploy.conf
[root@meriadoc]:> more registerAppDeploy.conf
control:
actionsequence = (
shellcommands.stopTomcat.registerAppDeploy
tidy.registerAppDeploy
directories.registerAppDeploy
copy.registerAppDeploy
links.registerAppDeploy
shellcommands.startTomcat.registerAppDeploy
)
APPBASE = ( /webapps/register-8006 )
SOURCEDIR = ( /export/home/deploy )
shellcommands:
registerAppDeploy.stopTomcat::
'/bin/su - tomcat -c "${APPBASE}/bin/tomcat.sh stop"'
registerAppDeploy.startTomcat::
'/bin/su - tomcat -c "cd
${APPBASE}/webapps/RegistrationWebapp;/usr/apps/java/bin/jar xvf
../RegistrationWebapp.war"'
'/bin/su - tomcat -c "${APPBASE}/bin/tomcat.sh start"'
tidy:
${APPBASE}/webapps/RegistrationWebapp
recurse=inf
age=0
include=*
rmdirs=all
directories:
# below is nasty but need to make sure all dirs are owned by tomcat
registerAppDeploy::
${APPBASE}/webapps/RegistrationWebapp
mode=755
owner=tomcat
group=tomcat
${APPBASE}/webapps/RegistrationWebapp/WEB-INF
mode=755
owner=tomcat
group=tomcat
${APPBASE}/webapps/RegistrationWebapp/WEB-INF/lib
mode=755
owner=tomcat
group=tomcat
copy:
registerAppDeploy::
${SOURCEDIR}/bcom/stable/ext/lib
dest=${APPBASE}/lib
mode=750
owner=tomcat
group=tomcat
include=sax2.jar
include=commons-pool.jar
include=commons-dbcp.jar
include=xerces.jar
include=ora816jdbc.jar
ignore=CVS
recurse=1
type=checksum
backup=false
${SOURCEDIR}/bcom/stable/ext/lib
dest=${APPBASE}/webapps/RegistrationWebapp/WEB-INF/lib
mode=750
owner=tomcat
group=tomcat
include=log4j.jar
include=commons-collections.jar
include=commons-logging.jar
ignore=CVS
recurse=1
type=checksum
backup=false
${SOURCEDIR}/bcom/registration/registration-lib/resource
dest=${APPBASE}/classes
mode=750
owner=tomcat
group=tomcat
include=regprod.jocl
include=regqa.jocl
ignore=CVS
recurse=1
type=checksum
backup=false
${SOURCEDIR}/generated/RegistrationWebapp.war
dest=${APPBASE}/webapps/RegistrationWebapp.war
mode=750
owner=tomcat
group=tomcat
type=checksum
backup=false
${SOURCEDIR}/generated/Registration.jar
dest=${APPBASE}/webapps/RegistrationWebapp/WEB-INF/lib/R
egistration.jar
mode=750
owner=tomcat
group=tomcat
type=checksum
backup=false
links:
registerAppDeploy::
${APPBASE}/webapps/cdreg ->
${APPBASE}/webapps/RegistrationWeba
pp
${APPBASE}/webapps/registration ->
${APPBASE}/webapps/Registrat
ionWebapp
${APPBASE}/webapps/subscribe ->
${APPBASE}/webapps/Registration
Webapp
Basically:
Shutdown tomcat
Tidy ( remove ) old webapp
Copy files (parent file did cvs checkout) to destination
Create symlinks
Unjar webapp (tomcat won't auto deploy if dir exists)
Start tomcat
I don't do it here, but you could define a class for "overlap" and check
in subsequent files for that class to prevent the action from taking
place again.
wheeler
> -----Original Message-----
> From: Paul Dlug [mailto:paul@aps.org]
> Sent: Monday, March 24, 2003 2:25 PM
> To: help-cfengine@gnu.org
> Subject: Application management
>
> We have a stack of FreeBSD and solaris webservers behind load
> balancers. Most of our applications are pretty easy to deploy,
> requiring an apache install, some NFS mounts and some supporting
> software. I'd like to be able to run any application on any of our
> servers.
>
> I'm trying to break up the parts of our cfengine configuration from
the
> system specific to the application specific. I've been using the
groups
> to define applications, such as "Webserver", adding a host to this
> group causes it to copy an additional apache configuration file and
> restart the server. It also adds necessary NFS mounts. This would
> enable us to increase and decrease the number of hosts serving an
> application just by modifying a few group memberships.
>
> (Sorry for the long background).
>
> My issues are:
> - Package management: what methods are people using to manage FreeBSD
> and/or Solaris packages with cfengine? I'd like to use platform
> specific packages were possible instead of something like RPM or
OpenPKG
> - "Undo": how do you gracefully handle the case were a server has been
> removed from a group and should no longer have the
> software/mounts/configuration needed for that app.
> - Overlap: breaking up each application into a cfengine conf file
> leaves it self contained but creates overlaps (if different apps use
> the same NFS mount for example). What's the best way to define it once
> and list dependencies so that once the dependencies are gone the
> software decides it's no longer needed and removes it (thus solving
the
> above problem).
>
> Any suggestions would be greatly appreciated.
>
> (If anyone would like to collaborate on using cfengine for application
> management and monitoring please let me know. I'm really interested in
> bringing forward some concrete solutions other people can implement).
>
> --Paul
>
>
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-cfengine
- RE: Application management,
Wheeler, John <=