启动iSCSI相关服务,并且配置开机启动项;
[root@bogon Packages]# systemctl list-unit-files | grep iscsi
iscsi-shutdown.service static
iscsi.service enabled
iscsid.service disabled
iscsiuio.service disabled
iscsid.socket enabled
iscsiuio.socket enabled
[root@bogon Packages]# systemctl enable iscsi.service
扫描并识别ISCSI存储信息,由于Openfiler所用端口号为3260,所以在此扫描添加端口号;
[root@bogon Packages]# iscsiadm -m discovery -t st -p 192.168.60.11:3260
192.168.60.11:3260,1 iqn.2006-01.com.openfiler:tsn.6524fccc7d06
192.168.60.12:3260,1 iqn.2006-01.com.openfiler:tsn.6524fccc7d06
192.168.60.13:3260,1 iqn.2006-01.com.openfiler:tsn.6524fccc7d06
192.168.60.14:3260,1 iqn.2006-01.com.openfiler:tsn.6524fccc7d06
修改配置ISCSI软件开机扫描信息;
12 vi /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.2006-01.com.openfiler:tsn.6524fccc7d06
对扫描到的ISCSI识别存储进行登陆;
[root@bogon Packages]# iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.6524fccc7d06 -p 192.168.60.11:3260 -l
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:tsn.6524fccc7d06, portal: 192.168.60.11,3260] (multiple)
Login to [iface: default, target: iqn.2006-01.com.openfiler:tsn.6524fccc7d06, portal: 192.168.60.11,3260] successful.
[root@bogon Packages]# iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.6524fccc7d06 -p 192.168.60.12:3260 -l
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:tsn.6524fccc7d06, portal: 192.168.60.12,3260] (multiple)
Login to [iface: default, target: iqn.2006-01.com.openfiler:tsn.6524fccc7d06, portal: 192.168.60.12,3260] successful.
[root@bogon Packages]# iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.6524fccc7d06 -p 192.168.60.13:3260 -l
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:tsn.6524fccc7d06, portal: 192.168.60.13,3260] (multiple)
Login to [iface: default, target: iqn.2006-01.com.openfiler:tsn.6524fccc7d06, portal: 192.168.60.13,3260] successful.
[root@bogon Packages]# iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.6524fccc7d06 -p 192.168.60.14:3260 -l
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:tsn.6524fccc7d06, portal: 192.168.60.14,3260] (multiple)
Login to [iface: default, target: iqn.2006-01.com.openfiler:tsn.6524fccc7d06, portal: 192.168.60.14,3260] successful.
查看ISCSI当前登陆会话是否正常;
[root@bogon Packages]# iscsiadm -m session
tcp: [1] 192.168.60.11:3260,1 iqn.2006-01.com.openfiler:tsn.6524fccc7d06 (non-flash)
tcp: [2] 192.168.60.12:3260,1 iqn.2006-01.com.openfiler:tsn.6524fccc7d06 (non-flash)
tcp: [3] 192.168.60.13:3260,1 iqn.2006-01.com.openfiler:tsn.6524fccc7d06 (non-flash)
tcp: [4] 192.168.60.14:3260,1 iqn.2006-01.com.openfiler:tsn.6524fccc7d06 (non-flash)
安装Multipath多路径软件,并配置开机自动启动;
[root@bogon Packages]# rpm -ivh device-mapper-libs-1.02.107-5.el7.x86_64.rpm
warning: device-mapper-libs-1.02.107-5.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ################################# [100%]
package device-mapper-libs-7:1.02.107-5.el7.x86_64 is already installed
[root@bogon Packages]# rpm -ivh device-mapper-multipath-0.4.9-85.el7.x86_64.rpm
warning: device-mapper-multipath-0.4.9-85.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ################################# [100%]
package device-mapper-multipath-0.4.9-85.el7.x86_64 is already installed
[root@bogon Packages]# systemctl enable multipathd.service
[root@bogon Packages]# systemctl list-unit-files | grep multipath
multipathd.service enabled
[root@bogon Packages]# modprobe dm-multipath
[root@bogon Packages]# modprobe dm-round-robin
[root@bogon Packages]# systemctl start multipathd.service