|
I was recently put in charge of the task of finding an affordable and widely implementable solution for network storage that could be used for a near line backup solution. The solution had to allow all servers being backed up to have access to it, and allow access from the tape backup system. Of course, the solution also had to support multiple RAID configurations to prevent a catastrophic hard disk failure. After hours of searching, I decided to use the iSCSI Enterprise Target (IETD) (http://iscsitarget.sourceforge.net/) on a CentOS 5 Linux base operating system. Hardware Needs The following items are the hardware needs to setup this iSCSI solution. A Linux supported raid card, I am currently using the Adaptec RAID3405 SATA/SAS controller which retails for around $390. You will also need a motherboard which has the correct internal card slots for the RAID controller. In most cases this will mean a PCI Express (PCIe) x1, 36 pin internal card slot on the motherboard. More advanced combination SAS/SATA RAID controllers may require PCIe x4 internal card slots. A decent motherboard will normally retail between $150 and $300. Unless you have a separate gigabit Ethernet adapter available make sure there is at least one gigabit Ethernet connection on the motherboard. Remember iSCSI uses the network as the means of transferring and receiving data which is stored on the hard drives. A CPU, which does not have to be the top of the line, will normally cost around $100 to $300 depending on your processor. Remember this system will not be processing data, just handling storage functions which are mostly offloaded to the RAID controller. You should plan on at least 512MB of RAM; this will normally cost between $25 and $100 depending on the brand of memory, and the type required by your motherboard. Assuming that a monitor and all input devices are already owned, the final items needed for this affordable iSCSI storage solution are dependent on the needs of the person implementing the solution. They are a power supply with enough wattage and power leads to support the number of hard drives needed and a case big enough to hold everything. WARNING: Make sure that you have enough airflow in your case, a 500-1000 watt power supply and a bunch of large capacity hard disks can rapidly create CPU killing temperatures. The Adaptec RAID controller I mentioned above, will support four SATA or SAS hard drives without extenders. This small configuration fits nicely in a basic mid-size case with a 500 watt power supply. The power supply will run around $50 and the case will cost about the same. Quality SATA II hard drives, depending on capacity will cost about $150 each for the 500GB variety, while a 1TB drive will cost around $400 a piece. For a complete 2TB iSCSI storage solution, the cost will be roughly around $1400, unless you have this hardware lying around, then it will be significantly cheaper. This solution can be scaled upwards to larger then 2TB by using RAID controllers with more drive capacity, extenders, or multiple RAID controllers. With commercial iSCSI SAN solutions ranging ge from $5000 to $40,000 or more, a home built solution is often the right answer for many situations where every IT dollar is critical. 1. Set Up A CentOS 5 Linux System The first step to building an affordable iSCSI solution is to install CentOS 5 Linux on a computer similar to what is outlined above. Once installed, CentOS needs to be upgraded to the newest kernel and patch set. To do this use the following command at the console: # yum upgrade Once the upgrade completes, restart the computer and select the newest kernel when prompted during the boot process. Once the system is back up, open a command prompt and install the kernel-devel, openssl-devel, and gcc packages using the following command: # yum install kernel-devel openssl-devel gcc Once these packages are finished installing, obtain the newest version of iSCSI Enterprise Target from http://iscsitarget.sourceforge.net/. Unpack it using the following command at the console: # tar –xvfz iscsitarget-0.4.15.tar.gz Now change directory into the directory created by unpacking the tarball. These are the install files for the iSCSI target demon, install them by using the following command at the console: # make && make install Once the install finishes, the following command should be used so that the iscsi-target daemon will be started every time the operating system starts. At the command console type: # chkconfig iscsi-target on 2. Set Up The Target Drive(s) Now that the iscis-target daemon is installed, it must be setup for future use. First identify the hard drives that you plan to use for storage. To do this, type the following command at the console: # fdisk-lThis should provide a similar output as seen below. In the example you will notice that there are two hard drives attached, /dev/sda and /dev/sdb. For this example, /dev/sda is the bootable hard drive that CentOS 5 is installed on. /dev/sdb will be our storage drive. While this is not a RAID array in the example, a RAID array will produce the same output.
Now that the storage drive is identified, the configuration file for the iscsi-target needs to be modified to reflect the correct hard disk. To change the configuration file, type the following command: # vim /etc/ietd.conf While the /etc/ietd.conf is quite large only the following section needs to be editted to create our storage target. 
To create the target, edit the line “Target iqn.2001-04.com.example:storage.disk2.sys1.xyz” to reflect the name of the users choice. IQN stands for iSCSI Qualified Name and is typically presented in the iqn.YYYY-MM.(reverse domain name) format. I have changed my target line to “Target iqn.2008-02.com.jonesdykstra:storage.disk1” Below the target, there will be several lines which read similar to: 
We will edit the “Lun” line to match the informattion in the “fdisk -l” step above. An example of how this should all look together is: Target iqn.2008-02.com.jonesdykstra:storage.disk1 Lun 1 Path=/dev/sdb, Type=fileio If more then one disk or RAID array is to be used for iSCSI storage, then the configuration file would look something similar to. Target iqn.2008-02.com.jonesdykstra:storage.disk1 Lun 1 Path=/dev/sdb, Type=fileio Lun 2 Path=/dev/sdc, Type=fileio Lun 5 Path=/dev/sdf, Type=fileio Save the configurtion file and restart the iSCSI target by issuing the following command at the console. # service iscsi-target restart 3. Set Up The iSCSI Initiator Now that the iscsi-target is configured and started, an iSCSI initiator must be established so that other computers can connect to the iSCSI storage. An iSCSI initiator is software that replaces a traditional hardware iSCSI Host Bus Adapter (HBA). Instead of sending SCSI commands over a SCSI cable attached to disks the iSCSI initiator send SCSI commands over Ethernet. To install the initiator, use the follow command: # yum install iscsi-initiator-utils Once the iscsi-initiator service is installed it needs to be started. To start this service, type the following command at the console. # service iscsi start Once the iSCSI service starts, the target must be discovered by the initiator.We use the “iscsiadm” command in the following structure to discover the iSCSI target. # iscsiadm –m discovery –t sendtargets –p <IP address of the iSCSI storage computer>:3260 If a iSCSI target is found, output similar to the following should be observed. The target name will be whatever was entered when the ietd.conf file was edited. The first line in the example directs the initiator to discover iSCSI targets on a system with the IP address of 10.50.100.100. The iSCSI target daemon on our storage computer responds back with the IQN on the second line. 
Now that an iSCSI target has been identified, the iSCSI initiator must be set to start at bootup, to do this, type the following command. # chkconfig iscsi on After all of these steps are completed, a working iSCSI storage solution is implemented. Note that older versions of CentOS will not work with the steps defined above due to changes in the the iSCSI initiator software. To download these instructions in PDF format, use the following link: Affordable iSCSI Storage, Part 1.PDF |