A quick introduction to GFS2 over iSCSI
What does one do when a large, clustered environment, say 15 or more front-end application servers, starts to choke up an NFS server, or your nodes are reading stale data due to the NFS protocol limitations? What should you do when gigabit Ethernet no longer provides sufficient throughput on your back end storage infrastructure to deliver your files to the world wide web? You implement GFS2.
If you want to know more about the difference between these two filesystems, you can read the comparison here.
I recently set up a small test environment to muck around with GFS, and the result turned out fairly decent and didn’t take a whole lot of time, either.
I’m assuming that if you are reading my blog, technology interests you, and you have heard of GFS2 or the Red Hat Clustering Suite before. But what is it? How does it work? I’ll try to explain a bit about it here.
GFS2 operates on block devices, not virtual “export” directories or “shares”, like CIFS or NFS do. So how is that going to help us achieve a shared file system among all of our web servers if it operates on block devices? There are many answers to that question, only one of which I have explored so far. You can attach block storage to remote systems in a number of different ways, to name a few:
- iSCSI – Probably the easiest, certainly the least expensive.
- ATAoE – Similar to the above, however, ATA-over-Ethernet is exactly that, where iSCSI is Internet SCSI over TCP/IP.
- Fibre Channel – Probably the best-performing option, and probably the most expensive
At work, I will most likely be using Ethernet exclusively, so I naturally chose iSCSI as my transport. iSCSI will enable me to export a block device on my shared storage for use on multiple remote systems. Let’s explore how that is done, as without shared block storage, GFS2 isn’t going to do much for us.
Defining an iSCSI target
Firstly, we need to designate our iSCSI target, or in other words, the storage target that the application servers will be accessing. In this example I will be using just one iSCSI target, which I intend to later have serving my “vhosts” directory for web data. Let’s call our iSCSI target system ‘storage1′. It is going to need software for creating iSCSI targets, so let’s go ahead and install the package “scsi-target-utils”:
# /usr/bin/yum -y install scsi-target-utils
This package contains some useful commands that we will use to create the iSCSI target. namely, “tgtadm”. Before we can use any of them though, we need to start up the targeting service:
# service tgtd start Starting SCSI target daemon: [ OK ]
Now let’s attempt to create a new target. For simplicity’s sake, I will be naming this particular target “vhosts”. In other examples that I have read through, a rather long string was used as the target name. Using a short name like I am here may have its downside, but other than being easily identifiable I am not sure at this point what the significance is. Fire away:
(more…)