上面这个报错是因为scsi服务端的主机防火墙没有关闭,端口受到限制,关闭防火墙后,再尝试,就可以正常发现如下内容:
[root@jyrac1 ~]# iscsiadm -m discovery -t sendtargets -p 10.10.1.99
10.10.1.99:3260,1 iqn.2017-07.com.cnblogs.jyzhao:alfreddisk
[root@jyrac1 ~]# iscsiadm -m discovery -t sendtargets -p 10.10.2.99
10.10.2.99:3260,1 iqn.2017-07.com.cnblogs.jyzhao:alfreddisk
查看/var/lib/iscsi/nodes/下的文件:
[root@jyrac1 ~]# ll -R /var/lib/iscsi/nodes/
/var/lib/iscsi/nodes/:
total 4
drw------- 4 root root 4096 Jul 18 12:13 iqn.2017-07.com.cnblogs.jyzhao:alfreddisk
/var/lib/iscsi/nodes/iqn.2017-07.com.cnblogs.jyzhao:alfreddisk:
total 8
drw------- 2 root root 4096 Jul 18 12:12 10.10.1.99,3260,1
drw------- 2 root root 4096 Jul 18 12:13 10.10.2.99,3260,1
/var/lib/iscsi/nodes/iqn.2017-07.com.cnblogs.jyzhao:alfreddisk/10.10.1.99,3260,1:
total 4
-rw------- 1 root root 1822 Jul 18 12:12 default
/var/lib/iscsi/nodes/iqn.2017-07.com.cnblogs.jyzhao:alfreddisk/10.10.2.99,3260,1:
total 4
-rw------- 1 root root 1822 Jul 18 12:13 default
查看iscsiadm -m node
[root@jyrac1 ~]# iscsiadm -m node
10.10.2.99:3260,1 iqn.2017-07.com.cnblogs.jyzhao:alfreddisk
10.10.1.99:3260,1 iqn.2017-07.com.cnblogs.jyzhao:alfreddisk
iscsiadm -m node -T target名称 --login
iscsiadm -m node -T iqn.2017-07.com.cnblogs.jyzhao:alfreddisk --login
[root@jyrac1 ~]# iscsiadm -m node -T iqn.2017-07.com.cnblogs.jyzhao:alfreddisk --login
Logging in to [iface: default, target: iqn.2017-07.com.cnblogs.jyzhao:alfreddisk, portal: 10.10.2.99,3260] (multiple)
Logging in to [iface: default, target: iqn.2017-07.com.cnblogs.jyzhao:alfreddisk, portal: 10.10.1.99,3260] (multiple)
Login to [iface: default, target: iqn.2017-07.com.cnblogs.jyzhao:alfreddisk, portal: 10.10.2.99,3260] successful.
Login to [iface: default, target: iqn.2017-07.com.cnblogs.jyzhao:alfreddisk, portal: 10.10.1.99,3260] successful.
最后查询 fdisk -l结果:
省略之前无关内容...
Disk /dev/sdi: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sdj: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
发现通过两条链路(10.10.1.*和10.10.2.*),已经正常识别到两个大小为10G的磁盘,而实际上这两个磁盘对应到存储上的一个底层LUN。
这其实就是多路径。后续我会再根据这个环境测试multipath(Linux自带的多路径软件)的使用。
重启主机测试,这两个磁盘信息依然存在,说明iSCSI的配置没有问题。
multipath多路径实验02-配置多路径软件 见 https://www.linuxidc.com/Linux/2018-10/154929.htm
Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx