24 Feb 2009, 14:54
Tags: , , , , , , ,
Comments Off

MyLVMbackup: Making it cooperate with Debian

For making a consistent backup of MySQL data, mylvmbackup seems to be a great tool. It’s written in Perl and does what you would expect: Lock the tables, flush them all to disk, make a LVM snapshot and release the tables, recover the InnoDB log,make the backup from the snapshot, remove the snapshot. Minimal downtime and still a consistent backup. Although it’s fairly new, it looks good.

There’s even a Debian package for it, but that doesn’t really contain everything I need. First of all, I need a package that runs on Etch. There’s a dependency in the Debian package (which is for Lenny) on an asciidoc of a version that’s available only in Lenny. I don’t really see why that dependency is there at all, but when removing the version, the package still works as expected.

Also, I made two patches of which one is not needed at all, but I left it in there anyway, because it doesn’t break anything. It simply adds the –innodb-file-per-table option to the invocation of the mysqld_safe daemon, but that’s not needed since it only affects MySQL when you change data. But since mysqld_safe is used to recover from logs, you won’t be changing data. I left it in there anyway. You can find the dpatch file here.

The second one might be more interesting. The mysql-server-5.0 package from Debian creates a file /etc/mysql/debian.cnf with login details for the debian-sys-maint user. This user also has enough permissions to do all the things necessary for manipulating the database when we want to make a backup with mylvmbackup. Normally, mylvmbackup needs you to give it user details for a privileged user in /etc/mylvmbackup.conf, which is a bit double, since the debian.cnf exists. So my patch adds a –defaults_file option which allows you to mention the debian.cnf. No need for more passwords in plaintext on the filesystem! You can either give this option no the commandline or in the mylvmbackup.conf in the [mysql] section. It only supports Debian style debian.cnf, though, since it searched for a [client] section in the file you mention. You can find the patch here.

A working package can be found in Kumina’s Debian repository for both etch and lenny. Please let me know if this works for you! It’s my first Perl, though, so be warned. If stuff breaks… Well… Sorry… So be sure to test it.

Tags: , , , , , , ,

5 Jan 2009, 15:07
Tags: , , , , , , ,
Comments Off

Upgrade Debian Sarge to Etch: ColdFusionMX7 is a pain

So we’re finally getting around to upgrading an old Debian Sarge server which runs ColdFusionMX7 to Etch. The Debian part is easy, I simply edit the sources.list and do an apt-get dist-upgrade and some questions later, presto, the machine is a working Debian Etch machine.

Getting ColdFusionMX7 to run with the Etch supplied Apache 2.2 is a different matter. Took me about several weeks to find out (not full time, but still over 20 hours, I think). First of all, you need the modified wsconfig.jar that Adobe distributes via a knowledge base article about their hotfix. Don’t bother with their instructions, though, the mod_jrun22.so will not compile that way. Not because of missing apps or something, but because for some strange reason, the script thinks JRun is already up and running. I get an output like so:

Macromedia JRun 4.0 (Build 107948)
os.name: Linux
os.version: 2.6.18-6-xen-amd64
os.arch: i386
platform: intel-linux
Found port 2920 on host localhost
findServers(): found server coldfusion at 127.0.0.1:2920
Found JRun server coldfusion at 127.0.0.1:2920
this host is stage02:62.133.201.114
web server: Apache
web server directory: /etc/apache2
verbose connector logging: false
apialloc: false
force resource extract from jar: true
CFMX: true
mappings: .jsp,.jws,.cfm,.cfml,.cfc,.cfr,.cfswf
filter mapping prefix: false
Apache binary: /usr/sbin/apache2
Apache control script: /usr/sbin/apache2ctl
Apache apxs: true
This web server is already configured for JRun.

Not very helpful. I tried removing all files related to Apache and JRun that I could think of, including the part in /etc/apache2/httpd.conf that loads the module, but it still told me that the web server was already configured. Time for some heavier work.

First, start with unzipping the wsconfig.zip. It’ll yield a wsconfig.jar. Unzip that one too in a temporary directory, let’s say in /tmp/wsconfig. Now go to /tmp/wsconfig/controller/src. There’s a text file in there that contains the steps to install it. However, I need to install a few packages:

apt-get install apache2-prefork-dev gcc

You might need apache2-worker-dev, if you use that Apache flavour. You can check that with dpkg -l | grep apache2. You’ll find either apache2-mpm-prefork or apache2-mpm-worker. That’s your clue!

Now, execute the following commands:

sudo apxs2 -c -n jrun22 mod_jrun22.c  \
jrun_maptable_impl.c  jrun_property.c  jrun_session.c platform.c \
jrun_mutex.c jrun_proxy.c  jrun_utils.c

sudo apxs2 -i -n jrun22 mod_jrun22.la

sudo strip /usr/lib/apache2/modules/mod_jrun22.so

This will install the Apache 2.2 JRun module at /usr/lib/apache2/modules/mod_jrun22.so. Now change your Apache config accordingly, and you’re ready to go.

One thing I found, but that was just me trying to be hasty, was that you need to use:

LoadModule jrun_module /usr/lib/apache2/modules/mod_jrun22.so

Hope this helps someone.

Tags: , , , , , , ,

 
  • Search


  • Twitter

    • @ArjenNL Awstats is not real-time :S Need it for monitoring, not trending. Kinda strange there are no solutions, really. in reply to ArjenNL 1 day ago
    • @ArjenNL Thx, but that's a mod_watch solution :) I don't want to use mod_watch, since it seems unmaintained :) in reply to ArjenNL 1 day ago
    • Anyone know of a maintained mod_watch-alike solution for Apache2? Preferably one that's packaged for Debian... 1 day ago
    • Seems that no month can pass without us calling our telephony provider about a screw up on their invoice to us... 1 day ago
    • @KroosSara Ik vond Inception erg stoer, ondanks Leonardo. Beetje Matrix-achtige sfeer, maar heel ander verhaal (uiteraard). 2 days ago
    • More updates...

    Powered by Twitter Tools

  • Calender

    July 2010
    M T W T F S S
    « Jun    
     1234
    567891011
    12131415161718
    19202122232425
    262728293031  
  • Archives