Computing in the real world
SEARCH FOR: IN:
Guest  Level 00    Register Log in

Real World Computing

SAN on the cheap

18th January 2006 [PC Pro]

To realise the plan, we're going to use two identical Dell 1U rack-mount servers with two Gigabit Ethernet ports cross-connected. On to these servers we're then going to load a collection of open-source software. First, we're going to need an operating system, and it should be no surprise that the chosen OS is Linux. The variant we're going to use is CentOS 4. The Community ENTerprise Operating System project makes Red Hat Enterprise Linux (RHEL) available to the rest of us (that is, those who want to use the excellent RHEL but not spend £200 per year per server for updates). What CentOS does is take the Red Hat source code, compile it and repackage it. You therefore get all the good software that comes from Red Hat for free and, although you don't get support from Red Hat, you do get upgrades.

Recently, CentOS has also started rolling extra packages into its offering, two of which we're going to use. The first is 'heartbeat' from the Linux High Availability Project, with which we'll implement the active-passive failover. As its name suggests, heartbeat is a set of tools that allow a group of PCs to monitor each other's activity (via a heartbeat signal), detect 'death' and take over another machine's services. The other package we're going to employ is DRBD, which allows a block device (typically a disk partition) to be shared between two machines. The machine using the device is then set as the primary, and any update it makes to the device gets forwarded to the secondary; if the primary fails, then the secondary can be made primary. When the failed machine returns, it resynchronises with the current primary and then takes over.

Installing both of these into CentOS 4 is simple. First, issue the command 'yum groupinstall drbd-heartbeat'. Then to install the DRBD kernel module for your kernel, issue the command 'uname -r' to discover your operating system version. On our system, this gave the message '2.6.9-22.0.1.ELsmp', so to install the DRBD kernel module we issued 'yum install kernel-module-drbd-2.6.9-22.0.1.ELsmp'.

There's one last thing we need to install and that's the iSCSI target software itself. A quick check on the Internet will show three or four versions, but some of these aren't very active. The one we chose was a recently created project called the iSCSI Enterprise Target (iscsitarget.sourceforge.net). A surface skim of the website suggested that it wouldn't work on our chosen CentOS 4 system, as it needs kernel version 2.6.13 or better (we're running 2.6.9). However, this is a Red Hat-derived kernel, which means its kernel version number is somewhat 'eccentric'. All Red Hat packages tend to start off at a base level (2.6.9 in this case) and then have patches rolled into them, so some of the differences between 2.6.9 and later kernels are actually already there in the RHEL-derived kernel. We're sure there's more to it than that, but in essence someone has done the work for us, and a quick check of the Wiki-based documentation contains an installation guide for Red Hat. Having followed those instructions, the target software was installed on both machines.

Configuring iSCSI

Let's start with a simple scenario. We're going to take one disk on a machine and publish it via iSCSI. All the configuration work is done in one file on the machine, in /etc/ietd.conf, and we edited this file so it contained three lines:

IncomingUser joe secretsecret

Continued....