modperl_upgrading_production_machine

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



To: modperl@apache.org
From: Bill Moseley <moseley@hank.org>
Subject: Upgrading mod_perl on production machine (again)
Date: Tue, 16 Jan 2001 07:02:11 -0800

This is a revisit of a question last September where I asked about
upgrading mod_perl and Perl on a busy machine.

IIRC, Greg, Stas, and Perrin offered suggestions such as installing from
RPMs or tarballs, and using symlinks.  The RPM/tarball option worries me a
bit, since if I do forget a file, then I'll be down for a while, plus I
don't have another machine of the same type where I can create the tarball.
 Sym-linking works great for moving my test application into live action,
but it seems trickier to do this with the entire Perl tree.

Here's the problem: this client only has this one machine, yet I need to
setup a test copy of the application on the same machine running on a
different port for the client and myself to test.  And I'd like to know
that when the test code gets moved live, that all the exact same code is
running (modules and all).

What to do in this situation?

a) not worry about it, and just make install mod_perl and restart the server
and hope all goes well?

b) cp -rp /usr/local/lib/perl5 and use symlinks to move between the two?
When ready to move, kill httpd, change the perl symlinks for the binary,
perl lib, and httpd, and restart?

c) setup a new set of perl, httpd, and my application and when ready to go
live just change the port number? 

Or simply put - how would you do this:

With one machine I want to upgrade perl to 5.6.0, upgrade your application
code, new version of mod_perl, and allow for testing of the new setup for a
few weeks, yet only require a few seconds of downtime to switch live (and
back again if needed)?

Then I wonder which CPAN module I'll forget to install...



===

To: Bill Moseley <moseley@hank.org>
From: Greg Cope <greg@rubberplant.freeserve.co.uk>
Subject: Re: Upgrading mod_perl on production machine
(again)
Date: Tue, 16 Jan 2001 15:38:14 +0000

Bill Moseley wrote:
> 
> This is a revisit of a question last September where I asked about
> upgrading mod_perl and Perl on a busy machine.
> 
> IIRC, Greg, Stas, and Perrin offered suggestions such as installing from
> RPMs or tarballs, and using symlinks.  The RPM/tarball option worries me a
> bit, since if I do forget a file, then I'll be down for a while, plus I
> don't have another machine of the same type where I can create the tarball.
>  Sym-linking works great for moving my test application into live action,
> but it seems trickier to do this with the entire Perl tree.
> 
> Here's the problem: this client only has this one machine, yet I need to
> setup a test copy of the application on the same machine running on a
> different port for the client and myself to test.  And I'd like to know
> that when the test code gets moved live, that all the exact same code is
> running (modules and all).
> 
> What to do in this situation?
> 
> a) not worry about it, and just make install mod_perl and restart the server
> and hope all goes well?

Hum .... ignoring problem means that will bite you ! 

> 
> b) cp -rp /usr/local/lib/perl5 and use symlinks to move between the two?
> When ready to move, kill httpd, change the perl symlinks for the binary,
> perl lib, and httpd, and restart?

This is what I would do.

depending on present set up I would install all the above in a "new"
location - and then symlink to it.  Yup this does mean a few more disk
stat's, but means I can roll back most installs very quickly if
required.

Having said that I have not done it too often on an alien box.  Also is
the present perl easily simlinkable (i.e the binary and the lib tree).

I just play with the --prefix and usually do --prefix=package_version
(eg apache_perl_1.3.14 would be a mod_perl apache version 1.3.14).

Also you could script the change over if required to be xtra quick ....
(although this is getting silly)

I've used this without any issues on Linux boxes for 18 months, but I am
very conservative about my perl (i.e I'm still on 5.005_03 and waiting
for 5.6.1 ;-)

> 
> c) setup a new set of perl, httpd, and my application and when ready to go
> live just change the port number?
> 
> Or simply put - how would you do this:
> 
> With one machine I want to upgrade perl to 5.6.0, upgrade your application
> code, new version of mod_perl, and allow for testing of the new setup for a
> few weeks, yet only require a few seconds of downtime to switch live (and
> back again if needed)?
> 
> Then I wonder which CPAN module I'll forget to install...

do a CPAN snapshot bundle of a known good install, and install that -
easy no ?

===

To: Bill Moseley <moseley@hank.org>
From: Steve Reppucci <sgr@logsoft.com>
Subject: Re: Upgrading mod_perl on production machine
(again)
Date: Tue, 16 Jan 2001 11:02:44 -0500 (EST)

Not that I have an answer to this complete problem, but I have had similar
situation, so I'll also be interested in the solutions you uncover.

I've always handled the support of multiple perl versions by installing
new versions of perl using a prefix like /usr/local/perl/5.6.0, etc.,
(I also place CPAN's build directory under that tree.)

This makes it easy to install and test new versions of perl without
affecting running applications that have been built against a previous
perl version, as well as making it possible to test with specific versions
just by referencing the appropriate version in the script's shebang line
(or by setting my PATH appropriately when building mod_perl.)

Using this method, I symlink the "current default" version of perl and its
tools in the standard public directory (/usr/bin or /usr/local/bin).

Upgrading mod_perl versions has been a headache though, as I'm similarly
hesitant to simply 'make install' new mod_perl releases without being able
to test that all of my running applications work correctly.  I suppose
your idea of archiving the lib tree (/usr/local/perl/5.6.0/lib in my
setup) before running the 'make install' so that it's easy to roll back
should something fail is prudent.  But it still doesn't solve the problem
of being able to fully install (in its real final location, not in a
private directory...) new versions of mod_perl without affecting stuff
that's already running.  (Maybe I'm just tilting at windmills in worrying
about testing modperl from a private directory install...) 

So how *do* others handle this upgrade situation?

===

To: sgr@logsoft.com (Steve Reppucci), moseley@hank.org (BillMoseley)
From: dmccabe@videotron.net (David McCabe)
Subject: Re: Upgrading mod_perl on production machine (again)
Date: Tue, 16 Jan 2001 11:15:57 -0500 (EST)

> From: Steve Reppucci <sgr@logsoft.com>
> Date: Tue, 16 Jan 2001 11:02:44 -0500 (EST)
> Subject: Re: Upgrading mod_perl on production machine (again)
> 
> I've always handled the support of multiple perl versions by installing
> new versions of perl using a prefix like /usr/local/perl/5.6.0, etc.,
> (I also place CPAN's build directory under that tree.)
> 
> This makes it easy to install and test new versions of perl without
> affecting running applications that have been built against a previous
> perl version, as well as making it possible to test with specific versions
> just by referencing the appropriate version in the script's shebang line
> (or by setting my PATH appropriately when building mod_perl.)

That is what I do as well. Plus, I use the prefix arg to
build Apache as well, so a new mod_perl/Apache gets
installed in a different dir than the current one when I run
make install. I then copy over my config files to the new
dir, and set up the new Apache to listen on a different
port, then test it. Once tested, I point the sym-links for
both Apache and perl to the new locations.

This is whole process is scripted for me, for both Solaris
and AIX, and works great on both. (There are differences in
the scripts, though, because of differences in the OS)

BTW, for making sure you get all the modules your old perl
had, look at the CPAN module, which has a "autobundle"
command to create a Bundle file from your old perl
installation, that you can then use with your new perl, by
doing a "install Bundle::BundleName".

===

To: David McCabe <dmccabe@videotron.net>
From: brian moseley <bcm@maz.org>
Subject: Re: Upgrading mod_perl on production machine
(again)
Date: Tue, 16 Jan 2001 14:49:17 -0800 (PST)

On Tue, 16 Jan 2001, David McCabe wrote:

> > From: Steve Reppucci <sgr@logsoft.com>
> > 
> > I've always handled the support of multiple perl versions by installing
> > new versions of perl using a prefix like /usr/local/perl/5.6.0, etc.,
> > (I also place CPAN's build directory under that tree.)
> 
> That is what I do as well. Plus, I use the prefix arg to
> build Apache as well, so a new mod_perl/Apache gets
> installed in a different dir than the current one when I
> run make install. I then copy over my config files to
> the new dir, and set up the new Apache to listen on a
> different port, then test it. Once tested, I point the
> sym-links for both Apache and perl to the new locations.

we go one step further and install perl and other libraries
with each version of our application, into say
/usr/local/webmail/5.0.0.1 or whatever. that way everything
the application depends on is in the version-specific
directory.

we drive our entire build and install process with make; the
whole process is something like this (abbreviated):

  cvs co Makefile.webmail
  make -f Makefile.webmail checkout build install rpm

checkout pulls all the library and application sources from
cvs and scps pre-compiled distributions from a package
machine. build compiles everything. install puts it into
/usr/local/webmail/<version>. rpm packages up the
installation directory. then to deploy in production, we rpm
-i on each machine, and a post-install script flips the
symlink to point at the new version. rollback is trivial.

====
To: modperl@apache.org
From: rolf van widenfelt <rolf@pizzicato.com>
Subject: Re: Upgrading mod_perl on production machine
(again)
Date: Fri, 19 Jan 2001 12:09:54 -0800

face it, you are trying to perform surgery on a live subject...

with all the Makefiles you'll be making, (httpd, modperl, perl...) you're bound
to slip
on one of them and install over some of your existing stuff.

i went thru a conflict like this once, and avoided it by simply getting
a second machine, and installing all the new stuff there.

but, if someone can offer a procedure for setting up two independent httpd+modperl+perl
environments on one machine it would be pretty interesting!
(sorry, if this was already outlined in the responses last Sept)

===

To: <rolf@pizzicato.com>, <modperl@apache.org>
From: "Marc Spitzer" <mspitze1@optonline.net>
Subject: Re: Upgrading mod_perl on production machine
(again)
Date: Fri, 19 Jan 2001 16:15:16 -0500

make 2 directories:
/opt/local1
and
/opt/local/2

do an original install in /opt/local1, perl http mod_perl what ever packages
you need etc.  when it is time to upgrade do a new install in /opt/local2 of
what you need, run the httpd on an off port, i.e. port 8765, until you get
the new stuff working correctly.  turn off the old httpd and move the new
httpd to port 80, now you have achieved upgrade with a clean name space.
when you are sure that everything is working backup /opt/local1 and delete
all the files in it.  the next upgrade you need to do use /opt/local1 as the
build area.

marc

===


the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu