ISCSI configuration / multipath initiator on Linux RHEL 6 / CentOS 6
In this share, I will share a little of my knowledge about the implementation of hard disk uses using scsi-target-utils and initiator-utilities in RHEL / CentOS / Fedora Linux OS. Where in making the ISCSI hard drive, later in the next article we will use it for High availability Cluster Web Server storage server. For the installation and configuration of the hard drive on RHEL / CentOS / Fedora, as follows:
First prepare an LVM / normal partition that will be used for the disk drive, in this example LVM, using the name Volume Group = vgdata Logical Volume = iscsi-storage
Install the packages needed in making hard drive configuration:
# yum install scsi-target-utils iscsi-initiator-utils
# service tgtd start
# chkconfig tgtd on
Edit file initiatorname.iscsi pada folder /etc/iscsi/ dan set iscsi hostname:
# vim /etc/iscsi/initiatorname.iscsi
add the following code:
InitiatorName=iqn.2013-07.backlinux.com:storage-iscsi
Add configuration in /etc/tgt/targets.conf:
# vim /etc/tgt/targets.conf
enter/add the following code:
<target iqn.2013-07.backlinux.com:storage-iscsi>
backing-store /dev/vgdata/iscsi-storage
</target>
Jalankan service SCSI target daemon:
# service tgtd reload
# open firewall port 3260 dan 860 TCP/UDP
It’s time to check the results of our ISCSI work:
# tgt-admin -s
Add iscsi hard drive via network:
# iscsiadm -m discoverydb --type st --portal 192.168.100.120 --discover
# iscsiadm -m node -T iqn.2013-07.backlinux.com:storage-iscsi -l
# iscsiadm -m node --portal 192.168.100.120
-T iqn.2013-07.backlinux.com:storage-iscsi -l
# fdisk -l
Up to this stage, the workload of the hard disk has been completed, you can use it for your data storage needs. If you want to combine with a multipath method, do the following Multipath configuration:
# yum -y install device-mapper-multipath
# service iscsi start
# tgservice iscsid start
# chkconfig iscsi on
# chkconfig iscsid on
Create and configure multipath.conf files
# cp /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf /etc/
# vim /etc/multipath.conf
comment code /etc/multipath.conf, so that it looks like this:
## Use user friendly names, instead of using WWIDs as names.
# defaults {
# user_friendly_names yes
# }
un-comment and adjust the following code:
defaults {
udev_dir /dev
polling_interval 10
path_selector "round-robin 0"
path_grouping_policy multibus
getuid_callout "/lib/udev/scsi_id --whitelisted --replace-whitespace
--device=/dev/%n"
prio const
path_checker readsector0
rr_min_io 100
max_fds 8192
rr_weight priorities
failback immediate
no_path_retry fail
user_friendly_names no
}
blacklist {
# wwid 26353900f02796769
# devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
devnode "^hd[a-z]"
devnode "^vd[a-z]"
}
Update the kernel multipath module, run the iscsi and multipathd service:
# modprobe dm-multipath
# service multipathd start
# chkconfig multipathd on
# service iscsi restart
# multipath -ll
Next, if you want to format the file system, do the following on the Iscsi hard drive that has been created:
# fdisk -cu /dev/mapper/1IET_00010001
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p Partition number (1-4): 1
First sector (2048-4194303, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-4194303, default 4194303):
Using default value 4194303
Command (m for help): p
Disk /dev/mapper/1IET_00010001: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders, total 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x7c96cb68
Device Boot Start End Blocks Id System
/dev/mapper/1IET_00010001p1 2048 4194303 2096128 83 Linux
Command (m for help): w
If you are using Windows 7, do the following for mounting an ISSSI hard drive that has been created:
* Administrative Tools => Computer Management => Storage => Disk management
