August 28, 2005
The most important part of
any website is the data. Without data, you don't have anything to
put on your website. Because of this, it is very very important to
make sure all your data is secure. On your server, your data is stored
on hard drives and as we all know, hard drives will fail sooner or later.
Since I've had more than my fair share of hard drive failures, I've become
pretty paranoid about keeping the data on my drives secure. Some
people rely on regular backups to save their data. This is good,
but if your hard drive does fail, you'll lose all the data between the
the failure and the last backup. Because of this, I really like having
a RAID 1 setup for data protection.
RAID stands for Redundant
Arrays of Inexpensive Disks. There are several levels of RAID, some
are optimized for performance, some for security, and some for both.
We're most interested in RAID Level 1 or simply "RAID 1" or "Mirroring".
In RAID 1, we have 2 hard drives that are mirrored to each other in real-time.
Both drives contain the exact same information. When you save data
to the RAID 1, the same data is written to both drives. This is for
redundancy and security. Now if one member of the RAID 1 happens
to fail, then the server continues to run with the other good drive.
The two drives appear as 1 drive with the capacity of a single drive.
For example, a RAID 1 with 2 hard drives of 200 GB each will show up in
your operating system as 1 hard drive with a capacity of 200 GB.
As you can see, the second drive is there to mirror the 1st hard drive,
and you don't gain the extra space from that drive.
A RAID 1 setup is designed
for security, but there is also a performance boost with having a RAID
1. Disk writing will show no improvement since the computer writes
to both drives at the same time, the same information. However, disk
reading speed is doubled (theoretically) because the computer can read
from both drives at the same time which speeds things up. The actual
performance gain is less than 2x because of communication overhead.
Having a RAID 1 doesn't mean
that you don't have to backup anymore. A RAID 1 saves you in case
one of the drives fails, however, it won't save you from viruses, worms,
and stupid user mistakes. You still have to back up regularly.
It is best if both drives
are the same exact model, but you can still have a RAID 1 with drives that
are different. If you do use 2 drives that are different, the RAID
will have the final capacity of the smaller drive and will only be as fast
as the slowest drive. For example, if you have a 120 GB 5400 RPM
and a 200 GB 7200 RPM drive together in a RAID 1, the RAID 1 will have
a capacity of 120 GB and will be as fast as the slower drive (the 5400
RPM one).
On a server, you can choose
to RAID just the data drives or everything including the system drives.
Currently, my server has a single 20 GB boot drive and the data drive is
a RAID 1 with 2 x 80 GB drives. This setup keeps my data safe, but
a better setup would be to have everything RAID'ed. The reason is
that if my boot drive goes down, I will suffer significant downtime as
I buy a new boot drive, load the operating system, and reinstall all the
programs. If my operating system and programs were mirrored, then
I would have zero downtime. This actually didn't occur to me until
I started writing this article! I had figured for the past couple
years that at least my data would be safe. That's true, but without
a OS and program files, I'm still pretty screwed. Hmmm.. I'm gonna
have to make some changes to my server. These articles are self enlightening
:)
I think RAID 1 is a great
idea. I have RAID's set up on almost every computer I use.
It's does cost money, but some of the data that I work with is worth much
more than the cost of the RAID. Many new computers have built in
RAID controllers, but for many people, we have to purchase separate RAID
controllers that fit in a PCI slot. Don't skimp here. Don't
buy some off-brand RAID controller that you find at the computer show.
This is your data we're talking about. I have had fantastic results
with Promise Technology's line of RAID controllers. The great thing
about the Promise controllers is that they are fairly inexpensive and work
very well. Their driver support is good as are their monitoring utilities.
I am not being paid by Promise (although I wouldn't mind), I've simply
had very good experiences with Promise RAID controllers. I like the
Promise FastTrak 100 TX2 which I have on 4 of my computers. It can
he had for about $80 from various vendors.
Here I'm gonna show you my
RAID 1 setup for my desktop workstation.
In Windows XP under the device
manager, the Promise FastTrak 100 TX2 shows up under "SCSI and and RAID
controllers".
You configure the drives
that are attached to the RAID controller through the RAID Bios which comes
up at boot up. I don't have these screens, sorry. Once the
drives are configured, they show up under "Disk drives" as "Promise 1x2
Mirror/RAID1 SCSI Disk Device".
Promise has a very cool utility
called the "FastCheck Monitor Utility" which allows you to monitor the
status of the drives connected to the Promise controller.
If you double-click on the
"FastCheck Monitor Utility" you will see this main information page.
As you can see in the "Array"
tab, I have 4 hard drives connected to my Promise controller, 2 x 60 GB
Maxtor drives and 2 x 200 GB Seagate drives. These appear as 2 hard
drives in "My Computer", a 60 GB RAID 1 and a 200 GB RAID 1.
When you click on "Array
1" you can see the status of this drive is "Functional". Everything
looks good.
When I click on "Array 2",
I see the status is "Critical". Aww, crap. It turns out that
the 2 drives have fallen out of synchronization. This happened because
the power connectors to one of the drives accidentally got disconnected
while the computer was running which momentarily shut the drive down.
When you click on an individual
hard drive, you can see the status is "Functional (Rebuilding)".
This utility, by default, is set to resynchronize mirrored drives when
they happen to fall out of synchronization. Given enough time, the
utility will eventually rebuild the out of synch drive to match the good
drive.
Another thing to pay attention
to here is the SMART Status. The SMART status is very useful to letting
you know if the drive is on the brink of failing, even if it hasn't actually
failed yet. SMART monitors certain drive parameters and when the
parameters fall outside of drive specifications, it's a bad sign that the
drive isn't in good shape. If you have a drive with SMART failure
but is still working, I would replace it right away.
Under the "Controller" tab
you can see information about the controller and how the drives are connect
to the controller. The controller has 2 channels which in turn can
hold 2 drives. A RAID'ed pair of drives connected on the separate
channels is faster than RAID'ed drives that are connected to the same channel.
So for a particular RAID drive, you want to have the 2 drives on different
channels. You can see that for each RAID set, the drives are set
on different channels. Array 1 has one drive one channel 1
and one on channel 2. Array 2 is also setup this way.
In the "Options" tab, you
can configure the FastCheck Monitoring Utility to perform certain tasks
when a drive goes down. Each one of these settings is fairly self
explanatory and you can play with them with no problem. Conversely,
the default settings work just fine.
The only setting I changed
from default was to set the "Rebuild Rate" from Low to High. If a
drive goes down, I want it rebuilt as fast as possible. The reason
the default is slower is so that the rebuild doesn't take too much CPU
time.
That ends our tour of RAID
1 drives. I find that I sleep a bit better knowing that my server
won't be taken out by a hard drive failure. Considering how important
my data is to me, a RAID 1 helps me insure my data is as safe as possible.
Brian
|