Monthly Archives: November 2007

RH436 Qualified

For the last week I have been in Melbourne undergoing training for the RH436 course and exam.

I am pleased to announce that I have passed the exam, and have now added the RH436 endorsement to my existing RHCE qualification!

For those who are unfamiliar with Redhat’s courses, the RH436 course is one of the 5 main components of the Redhat Certified Architect qualification, which is another level above RHCE.

RH436 is a 4-day course which covers clustering and storage management. This includes the following technologies:

  • RAID/LVM
  • device-mapper
  • udev
  • Redhat Cluster Suite
  • GFS (a clustered filesystem)

The main reason I was interested in clustering was for automated failovers, and it is clear that Redhat have put together a powerful distribution for clustering.

An example application is for running a mission-critical website. With a cluster, you can setup multiple nodes/servers, and in the event of a failure, the website service will be automatically moved to another node, with the aim of providing minimal disruption.

Of course, there are far more advanced uses and capabilities such as load sharing, shared storage, etc.

Over the next couple of months I will be experimenting with my new clustering knowledge and combining it with technologies like Xen vitalization, in the aim of developing designs for rock-solid, secure, and fault-tolerant cluster implementations, which I will release on my website.

It is certainly clear to me that Xen and clustering will change the way we run servers.

I intend to do some presentations to Wellylug about clustering and Xen over the next few months, which I will also turn into articles and make available on my website.

Moving LVM physical volumes with pvmove

 < jethro> awh crap....
 < jethro> the LVM howto didn't mention that is wasn't safe to
           move the /  filesystem whilst it was in use
 * jethro deadlocked the server
 < jethro> I sure hope it'll work after reboot
 < friend1> (simulate a tension-filled pause here)
 < friend2> o_O
 < friend1> err
 < friend1> heh
 < friend1> where'd you move it to?
 < jethro> from one physical LVM volume to another with pvmove
 < jethro> I think the LVM is toast now though... :-(
 < jethro> yup, it's toast. #$$@!#%

What does that mean? It means that I found out the hard way that it IS NOT safe to move a live LVM physical volume from one disk to another with the pvmove command IF the physical volume contains the / filesystem.

Apparantly the problem is that the binaries are in use when it tries to move itself and causes the system to dead lock. :-(

Yum looking for a media repo

Ever had a problem where yum will look for the media repository, despite the fact that there is no configuration in place to use that repo, and you’ve completely cleaned out the cache?

This had me completely stumped, however I finally found the fix.

If you create a local yum mirror repository using the ISO images (I did this so I didn’t have to download all the RPMs again), the repodata/ directory ends up contains some XML files that specifically identify it as a local media repo, not as an online one. These XML files then screw up yum and make it look like yum is trying to connect to a non-existent media repository.

The fix is to that if you are creating a yum repo, make sure the repodata/ folder is mirrored from an existing online repo, not an ISO.

Misc tips and tricks

DD PROGRESS REPORTS
Redhat magazine has an interesting tip by Andrew C. Dingman on how you can make the dd command give you progress reports whilst it is still running. Read the article here

History of Slashdot
Slashdot is a very popular news site for computer geeks. If you are one of it’s thousands of readers, you may be interested in the recent “History of Slashdot” articles CmdrTaco wrote.

Part 1: Chips & Dips
Part 2: Explosions
Part 3: Going Corporate
Part 4: Yesterday, Today, Tomorrow

Computer Paranoia
I came across a collection of humorous tales of computer-illiterate users. Read here

Adjust dates by months and years in perl

I recently needed to subtract 1 month from a date for a perl program I was working on. Whilst subtracting days or weeks is easy as you can just convert it to a timestamp, adjusting months or years is far harder due to all the complexity of having to deal with different numbers of days in months, leap years, etc.

Took me a little while to find the best function to use, but there is a perl module that can do this for you called Date::Calc, which provides a function called Add_Delta_YM.

This function will handle all the complexity, and will round to the closet date in the previous month, handling situations like “2007-03-31 – 1 month == 2007-02-28” in a nice fashion.

Below is a code sample:

 #!/usr/bin/perl

 use strict;
 use Date::Calc qw(:all);

 my $year  = "2007";
 my $month = "3";
 my $day   = "31";

 my $Dy    = "0";    # number of years to adjust by
 my $Dm    = "-1";   # number of months to adjust by (-1 means go back 1 month)

 ($year,$month,$day) = Add_Delta_YM($year,$month,$day, $Dy,$Dm);

 print "$year-$month-$day\n";

If you need to do any other type of date manipulation, I suggest you look into the Date::Calc module to see if it fulfills your needs. As an added plus, if your a RHEL/CentOS user the module is available in the base repository.