I've recently been asked to build a redundant mailstore, using two server-class machines that are running Ubuntu. The caveat, however, is that no additional hardware will be purchased, so this rules out using any external filestorage, such as a SAN. I've been investigating the use of DRBD in a primary/primary configuration, to mirror a block device between the two servers, and then put GFS2 over the top of it, so that the filesystem can be mounted on both servers at once.
While a set-up like this is more complex and fragile than using ext4 and DRBD in primary/secondary mode and clustering scripts to ensure that the filesystem is only ever mounted on one server at a time, it's likely that there will be a requirement for GFS on the same two servers for another purpose, in the near future, so it makes sense to use the same method of clustering for both.
The following guide details how to get this going on Ubuntu 10.04 LTS (lucid). It won't work on any version older than this - the servers that this is destined for were originally running 9.04 (Jaunty), however, I've tested DRBD+GFS on that release, and there's a problem that prevents it from working. As far as I'm concerned, production servers should not be run on non-LTS Ubuntu releases, anyway, because the support lifecycle is far too short. This guide should also work fine for Debian 6.0 (squeeze), although I haven't tested it, yet.
Ever had a situation where you need to rebuild a Debian or Ubuntu package on a regular basis, but it takes an incredibly long time because it's running automatic tests - tests that you don't need until your final build?
For many of these packages, there's a simple way to disable the tests, by setting the DEB_BUILD_OPTIONS to "nocheck", before you build the package:
apt-get source openldap
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -rfakeroot
Not all packages support this, however, and some packages might use 'notest' instead.
There are a number of other values that can be used with DEB_BUILD_OPTIONS, too, if the package supports them:
noopt - turn off optimisation
nodocs - don't build documentation
nostrip - do not strip debugging symbols from binaries
parallel=n - use n parallel processes to build the package
I don't know what it is with the Ubuntu developers; they seem to be going out of their way to make their distribution as unpleasant to use as is humanly possible. If it wasn't bad enough that they slow it down by running the default desktop with pointless animations, and playing annoying drumbeats at boot time, they disable potentially useful features like menu tearoffs and then move everyone's titlebar buttons across to the left side, ignoring their previous defaults.
Here's a script to fix up these inanities:
# Put the buttons on the right, where they should be
gconftool-2 --type string --set /apps/metacity/general/button_layout ":minimize,maximize,close"
Every new release of Ubuntu seems to break something that was working on my systems, and it was no different with the 10.04 release of Ubuntu: my Huawei e169 mobile broadband modem, which can be used in Australia on the Optus, Vodafone and Virgin mobile networks, and in Europe almost everywhere, stopped working.
The device would appear in the filesystem, but no matter what I did, it refused to connect.
It's quite easy to fix this, in fact. Firstly, install the usb-modeswitch package:
sudo apt-get install usb-modeswitch
Then create the file /etc/udev/rules.d/75-e169.rules with the following contents: