Iscsi Installation on CentOS 5.1

Home » Computer Articles » Linux » Iscsi Installation on CentOS 5.1
May 23, 2008 Linux No Comments
Do all updates on Server

Other needed applications

yum install sysstat (For utilities, iostat etc)

Installation of Iscsi Target software

wget easynews.dl.sourceforge.net/sourceforge/iscsitarget/iscsitarget-0.4.16.tar.gz
tar zxvf iscsitarget-0.4.16.tar.gz
cd iscsitarget-0.4.16
make
make install

Disk partition

Make sure you have GPT Kernel Support. (CentOS and Redhat Enterprise has this option enabled by default)

File Systems > Partition Types >

  • Advanced partition selection and
  • EFI GUID Partition support
Use parted and add LVM Partitions of the size you would like.
Example:
parted /dev/sda
mklabel gpt (Creates a new GPT disklabel)
mkpart primary 0 3001G (Create 3TB partition size)
quit
mkfs.ext3 /dev/sda1 (Use mkfs to format file system)

Configuration of Iscsi Target software

vi /etc/ietd.conf add similar to below, Lots of examples is file.
Will need to check to see if we need more options added then
this. I check Openfiler and this is basically what they had in the file.
Target iqn.2008-04.com.dbarticles.ServerName.disk2.sys1
Lun 0 Path=/dev/hdb1,Type=fileio
Alias sys2
Target iqn.2008-04.com.dbarticles.ServerName.disk2.sys2
Lun 0 Path=/dev/hdb2,Type=fileio

Alias sys2

InitialR2T Yes
ImmediateData Yes
MaxRecvDataSegmentLength 131072
MaxXmitDataSegmentLength 131072
MaxOutstandingR2T 8

Start and Stop Iscsi Target Services

/etc/init.d/iscsi-target start
/etc/init.d/iscsi-target stop
/etc/init.d/iscsi-target restart
/etc/init.d/iscsi-target status

Setup IscsiTarget server to start with server

chkconfig iscsi-target on

Security setup for ip addresses you want to connect to a disk partition

vi /etc/initiators.deny
ALL ALL
vi /etc/initiators.allow and add entries below
iqn.2008-04.YourDomainName.ServerName.disk2.sys1 192.168.0.42
iqn.2008-04.YourDomainName.ServerName.disk2.sys2 192.168.0.43
Multiple Servers to the same disk

iqn.2008-04.YourDomainName.ServerName.disk2.sys1 192.168.0.42, 192.168.0.43

Example: iqn.2008-04.com.dbarticles.ServerName.disk2.sys2 192.168.0.43

If you add and/or remove a ip address you will have to restart the Iscsi Target Service.

Performance Adjustments

Edit sysctl.conf and add theses changes
# 3Ware Performance Adjustments
vm.dirty_background_ratio = 20
vm.dirty_ratio = 60
# Network Performance Adjustments
net.core.rmem_max = 1048576
net.core.rmem_default = 1048576
net.core.wmem_max = 1048576
net.core.wmem_default = 1048576
net.ipv4.tcp_mem = 1048576 1048576 1048576
net.ipv4.tcp_wmem = 1048576 1048576 1048576
net.ipv4.tcp_rmem = 1048576 1048576 1048576
Share This:

Leave a Reply

Your email address will not be published. Required fields are marked *