What is iSCSI?
iSCSI (Abbreviation for SCSI Internet) is a standard that allows the use of protocol SCSI about networks TCP/IP. iSCSI is a transport layer protocol defined in the SCSI-3 specifications. Other protocols at the transport layer are SCSI Parallel Interface and fiber channel.
The adoption of iSCSI in corporate production environments has currently accelerated thanks to the increase in Gigabit Ethernet. The manufacturing of iSCSI-based storage (red de área de almacenamiento) is less expensive and is proving to be an alternative to Fiber Channel-based SAN solutions.
we install the software iSCSI initiator.
Redhat or derivatives:
yum install iscsi-initiator-utilsDebian or derivatives:
aptitude install open-iscsiWe establish node.startup in automatic mode
[root@redorbitaclus01 ~]# vi /etc/iscsi/iscsid.conf
[…]
node.startup = automatic
[…]using the command iscsiadm we use iSCSI discovery
[root@redorbitaclus01 ~]# iscsiadm -m discovery -t st -p 192.168.1.20:3261
192.168.1.20:3261,3 iqn.2011-03.org.example.istgt:redorbitaclus
[root@redorbitaclus01 ~]# iscsiadm -m discovery
192.168.1.20:3260 via sendtargets
192.168.1.20:3261 via sendtargetsIf we want to know what information was stored about the discovered target, we have to operate in node mode
[root@redorbitaclus01 ~]# iscsiadm -m node –targetname iqn.2011-03.org.example.istgt:redorbitaclus -p 192.168.1.20:3261We proceed to log in to an iSCSI target
[root@redorbitaclus01 ~]# iscsiadm -m node –targetname «iqn.2011-03.org.example.istgt:redorbitaclus» –portal «192.168.1.20:3261» –login
Logging in to [iface: default, target: iqn.2011-03.org.example.istgt:redorbitaclus, portal: 192.168.1.20,3261] (multiple)
Login to [iface: default, target: iqn.2011-03.org.example.istgt:redorbitaclus, portal: 192.168.1.20,3261] successful.We check the sessions
[root@redorbitaclus01 ~] iscsiadm -m session -o show
tcp: [2] 192.168.1.20:3261,-1 iqn.2011-03.org.example.istgt:clustomcat
[root@redorbitaclus01 ~] netstat -n -p|grep 3260
tcp 0 0 192.168.1.80:39147 192.168.1.20:3261 ESTABLISHED 1929/iscsidWe format and mount the disk.
We check that we have a new device added
[root@redorbitaclus01 ~] dmesg
[ 2189.095341] sd 3:0:0:0: Attached scsi generic sg2 type 0
[ 2189.102983] sd 3:0:0:0: [sdb] 55924032 512-byte logical blocks: (28.6 GB/26.6 GiB)
[ 2189.113045] sd 3:0:0:0: [sdb] Write Protect is off
[ 2189.113051] sd 3:0:0:0: [sdb] Mode Sense: 83 00 00 08
[ 2189.113939] sd 3:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn’t support DPO or FUA
[ 2189.129843] sdb: sdb1
[ 2189.137121] sd 3:0:0:0: [sdb] Attached SCSI diskWe format and mount the disk:
[root@redorbitaclus01 ~] mkfs.ext4 /dev/sdb
[root@redorbitaclus01 ~] mount /dev/sdb1 /backupWe configure fstab to start the disk:
/dev/sdb1 /backup ext4 defaults 0 2Finally we configure so that ISCSI starts automatically
Redhat or derivatives:
chkconfig iscsi onDebian or derivatives:
update-rc.dopen-iscsi enableRegards, rokitoh
:wq!
Comments