Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Monday, December 10, 2007

The joys of real hardware

I'm working on building some new linux firewalls right now. It's the same redundant dual trunked interface setup I've been using for a while now. I have two identical boxes that plug into trunk ports the switches. They run heartbeat for fail over.

Here are two things to do when building machines in the real world (ie, not virtualized):

  • don't put VLAN=yes in the base ifcfg configuration file. I did this and it took me about 3 hours of rebuilding network card drivers to figure it out. It turns out that the vlan code in linux can't create a null vlan for eth0 and the error message looks like you're using the wrong driver.
  • make sure both of your network cables are plugged into the right ports. If both ports on the server show link, but only one works, you should probably check the link state on the switch.
Whoops. That's half a day I'll never get back. At least it's all running now.

Saturday, December 1, 2007

Mirroring CentOS

I need a local mirror of CentOS again. But I only want CentOS 5. I've done this before, but I figure I should post the script so that I don't have to write it from scratch again next time.

#!/bin/bash

# change to limit
# bandwidth
BWLIMIT=256

# call the script with '1' or something
# to make it display progress
VERBOSE=$1

# these can all be lists of
# the sub trees you're looking for
VER="5"
ARCHLIST="i386 x86_64"
BASELIST="os updates"

# where is your local repo?
LOCAL=/tmp/centos

RSYNC=rsync

# mirrir list available at http://www.centos.org/modules/tinycontent/index.php?id=13
MIRROR="rsync.FIXME::centos"

rsync_cmd="$RSYNC -aHz --delete"

if [ "x$VERBOSE" = "x" ]; then
rsync_cmd="$rsync_cmd -q"
else
rsync_cmd="$rsync_cmd -v --progress"
fi

if [ "x$BWLIMIT" != "x" ]; then
rsync_cmd="$rsync_cmd --bwlimit=$BWLIMIT"
fi


for ver in $VER; do
for arch in $ARCHLIST; do
for base in $BASELIST; do
if [ ! -d $LOCAL/$ver/$base/$arch/ ]; then
mkdir -p $LOCAL/$ver/$base/$arch/
fi
$rsync_cmd $MIRROR/$ver/$base/$arch/ $LOCAL/$ver/$base/$arch/
done
done
done
This is based on the original I found on the CentOS Mirroring page by a somewhat anonymous jlar310.

My script is nice because you can run it silently as a cron, or pass -v (or anything, really) on the command line and watch it go.

Saturday, June 16, 2007

OCFS2 Looks Interesting

There was a discussion on the CentOS mailing list the other day about Oracle Cluster File System 2. I went and checked it out. Well, I read some docs about it anyway.

It's released under the GPL and it's not really just for Oracle. It looks to be a share nothing type file system layer. Oracle uses it for RAC, I believe. Of course RedHat doesn't ship it -- it would eat into their GFS sales. Oracle does distribute RPM's for RedHat/CentOS though.

I've played around with DRDB for replication/fail over before. It works pretty well, but you definitely feel blind on your secondary machine since you don't have the shared partitions mounted. With MySQL starting to push DRDB for MySQL failover, I wonder if this would work better. You'd still want to use heartbeat to control where MySQL is running, but at least you'd be able to see everything on each node.

It also may be a decent alternative to replication if you're just using MyISAM. This may be good for scaling out data warehouses -- having only one master updating files and many slaves reading those files.

Another interesting use would be for apache document roots. It gets around having to sync each web server node's document root (if you take a share nothing approach), or using an NFS server (if you use NFS).

I haven't really looked into how well OCFS2 handles node additions (I'm guess you have to restart the cluster). Nor what happens when a node gets out of sync.

Sooner or later I'll install and test it out.