ConfigurationInitiatorEnd
1. Installing the Initiator software on the initiator host
# yum-y Install Iscsi-initiator-utils
2. discover and connect to the Target store on the initiator host
# iscsiadm-m Discovery-t sendtargets-p192.168.136.101
# The target service is found and the information is written to the/VAR/LIB/ISCSI directory
# tree/var/lib/iscsi/# View target Information
3. start the Iscsid service
#/etc/init.d/iscsid Start # start the Iscsid service first
#/ETC/INIT.D/ISCSI Start # Restart the iSCSI service This service is based on the ISCSID service information/var/lib/iscsi/to identify the device
4. Check the device file name assigned to the iSCSI target device on the initiator host
# LSBLK
# tree/var/lib/iscsi/
CheckiSCSIdisk Configuration, as well as uninstall and loginScsiEquipment
# LSBLK
# tree/var/lib/iscsi/
# iscsiadm-m Node-tiqn.2017-03.centos-i1:target1–u # Uninstall, the case here is a double path
Logging out of Session[sid:1, Target:iqn.2017-03.centos-i1:target1, portal:192.168.20.101,3260]
Logging out of Session[sid:2, Target:iqn.2017-03.centos-i1:target1, portal:192.168.136.101,3260]
Logout of [Sid:1, Target:iqn.2017-03.centos-i1:target1, portal:192.168.20.101,3260] successful.
Logout of [Sid:2, Target:iqn.2017-03.centos-i1:target1, portal:192.168.136.101,3260] successful.
# lsblk # Verify that the device is logout
# iscsiadm-m Node-tiqn.2017-03.centos-i1:target1–l # re-login, the case here is a two-path
Logging in to [Iface:default, Target:iqn.2017-03.centos-i1:target1, portal:192.168.20.101,3260] (multiple)
Logging in to [Iface:default, Target:iqn.2017-03.centos-i1:target1, portal:192.168.136.101,3260] (multiple)
Login to [Iface:default,target:iqn.2017-03.centos-i1:target1, portal:192.168.20.101,3260] successful.
Login to [Iface:default,target:iqn.2017-03.centos-i1:target1, portal:192.168.136.101,3260]successful.
UseiSCSIdevice, and do a write operation test
1. disk Partitioning (option two)
# FDISK/DEV/SDB
# PARTED/DEV/SDB
2. build the file system and use
# MKFS.EXT4/DEV/SDB1
# MKDIR/ISCSI # mount the partition to the new directory/iscsi
# mount/dev/sdb1/iscsi/
# cp/home/lb/fio*/ISCSI
In the course of the experiment, if you did a SDB partition on the target side, initiator cannot see the partition. The data in the partition needs to be re-partitioned according to the parameters of the target.
Set up multipath environment testing with iSCSI protocol on VMware Virtual Machine multipath (3)