2017-10-11 16:02:55 +00:00
|
|
|
|
-------------------------
|
|
|
|
|
iSCSI Initiator for Linux
|
|
|
|
|
-------------------------
|
2017-07-06 17:31:39 +00:00
|
|
|
|
|
|
|
|
|
**Prerequisite:**
|
|
|
|
|
|
2017-10-11 16:02:55 +00:00
|
|
|
|
- Package ``iscsi-initiator-utils``
|
2017-07-06 17:31:39 +00:00
|
|
|
|
|
2017-10-11 16:02:55 +00:00
|
|
|
|
- Package ``device-mapper-multipath``
|
2017-07-06 17:31:39 +00:00
|
|
|
|
|
|
|
|
|
**Installing:**
|
|
|
|
|
|
2017-07-12 22:11:25 +00:00
|
|
|
|
Install the iSCSI initiator and multipath tools:
|
2017-07-06 17:31:39 +00:00
|
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
|
|
# yum install iscsi-initiator-utils
|
|
|
|
|
# yum install device-mapper-multipath
|
|
|
|
|
|
|
|
|
|
**Configuring:**
|
|
|
|
|
|
2017-07-12 22:11:25 +00:00
|
|
|
|
#. Create the default ``/etc/multipath.conf`` file and enable the
|
2017-10-11 16:02:55 +00:00
|
|
|
|
``multipathd`` service:
|
2017-07-06 17:31:39 +00:00
|
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
|
|
# mpathconf --enable --with_multipathd y
|
|
|
|
|
|
2017-07-12 22:11:25 +00:00
|
|
|
|
#. Add the following to ``/etc/multipath.conf`` file:
|
2017-07-06 17:31:39 +00:00
|
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
|
|
devices {
|
|
|
|
|
device {
|
|
|
|
|
vendor "LIO-ORG"
|
|
|
|
|
hardware_handler "1 alua"
|
|
|
|
|
path_grouping_policy "failover"
|
|
|
|
|
path_selector "queue-length 0"
|
|
|
|
|
failback 60
|
|
|
|
|
path_checker tur
|
|
|
|
|
prio alua
|
|
|
|
|
prio_args exclusive_pref_bit
|
2017-10-11 16:02:55 +00:00
|
|
|
|
fast_io_fail_tmo 25
|
2017-08-08 23:14:57 +00:00
|
|
|
|
no_path_retry queue
|
2017-07-06 17:31:39 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-12 22:11:25 +00:00
|
|
|
|
#. Restart the ``multipathd`` service:
|
2017-07-06 17:31:39 +00:00
|
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
|
|
# systemctl reload multipathd
|
|
|
|
|
|
|
|
|
|
**iSCSI Discovery and Setup:**
|
|
|
|
|
|
2017-10-20 15:15:35 +00:00
|
|
|
|
#. If CHAP was setup on the iSCSI gateway, provide a CHAP username and
|
|
|
|
|
password by updating the ``/etc/iscsi/iscsid.conf`` file accordingly.
|
|
|
|
|
|
2017-07-12 22:11:25 +00:00
|
|
|
|
#. Discover the target portals:
|
2017-07-06 17:31:39 +00:00
|
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
2019-02-13 09:13:46 +00:00
|
|
|
|
# iscsiadm -m discovery -t st -p 192.168.56.101
|
2017-07-06 17:31:39 +00:00
|
|
|
|
192.168.56.101:3260,1 iqn.2003-01.org.linux-iscsi.rheln1
|
|
|
|
|
192.168.56.102:3260,2 iqn.2003-01.org.linux-iscsi.rheln1
|
|
|
|
|
|
2017-07-12 22:11:25 +00:00
|
|
|
|
#. Login to target:
|
2017-07-06 17:31:39 +00:00
|
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
|
|
# iscsiadm -m node -T iqn.2003-01.org.linux-iscsi.rheln1 -l
|
|
|
|
|
|
|
|
|
|
**Multipath IO Setup:**
|
|
|
|
|
|
|
|
|
|
The multipath daemon (``multipathd``), will set up devices automatically
|
|
|
|
|
based on the ``multipath.conf`` settings. Running the ``multipath``
|
|
|
|
|
command show devices setup in a failover configuration with a priority
|
|
|
|
|
group for each path.
|
|
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
|
|
# multipath -ll
|
|
|
|
|
mpathbt (360014059ca317516a69465c883a29603) dm-1 LIO-ORG ,IBLOCK
|
|
|
|
|
size=1.0G features='0' hwhandler='1 alua' wp=rw
|
|
|
|
|
|-+- policy='queue-length 0' prio=50 status=active
|
|
|
|
|
| `- 28:0:0:1 sde 8:64 active ready running
|
|
|
|
|
`-+- policy='queue-length 0' prio=10 status=enabled
|
|
|
|
|
`- 29:0:0:1 sdc 8:32 active ready running
|
|
|
|
|
|
|
|
|
|
You should now be able to use the RBD image like you would a normal
|
|
|
|
|
multipath’d iSCSI disk.
|