Linux:iSCSI
作者:互联网
[root@king03 ~]# yum install -y scsi-target-utils [root@king03 ~]# vi /etc/tgt/targets.conf <target iqn.2019-02.com.gscaifu:disk01> backing-store /dev/sdb initiator-address 192.168.1.0/24 incominguser gscf gscf@1234 write-cache off </target> <target iqn.2019-02.com.gscaifu:disk02> backing-store /dev/sdc initiator-address 192.168.1.0/24 incominguser gscf gscf@1234 write-cache off </target> <target iqn.2019-02.com.gscaifu:disk03> backing-store /dev/sdd initiator-address 192.168.1.0/24 incominguser gscf gscf@1234 write-cache off </target> <target iqn.2019-02.com.gscaifu:disk04> backing-store /dev/sde initiator-address 192.168.1.0/24 incominguser gscf gscf@1234 write-cache off </target> <target iqn.2019-02.com.gscaifu:disk05> backing-store /dev/sdf initiator-address 192.168.1.0/24 incominguser gscf gscf@1234 write-cache off </target> [root@king03 ~]# service tgtd start Starting SCSI target daemon: [ OK ] [root@king03 ~]# service tgtd status tgtd (pid 1599 1598) is running... [root@king04 ~]# netstat -tunlp | grep tgtd tcp 0 0 0.0.0.0:3260 0.0.0.0:* LISTEN 1879/tgtd tcp 0 0 :::3260 :::* LISTEN 1879/tgtd [root@king01 ~]# yum install -y iscsi-initiator-utils [root@king01 ~]# vim /etc/iscsi/iscsid.conf node.session.auth.authmethod = CHAP node.session.auth.username = gscf node.session.auth.password = gscf@1234 [root@king01 ~]# iscsiadm -m discovery -t sendtargets -p 192.168.1.203 192.168.1.203:3260,1 iqn.2019-02.com.gscaifu:disk01 192.168.1.203:3260,1 iqn.2019-02.com.gscaifu:disk02 192.168.1.203:3260,1 iqn.2019-02.com.gscaifu:disk03 192.168.1.203:3260,1 iqn.2019-02.com.gscaifu:disk04 192.168.1.203:3260,1 iqn.2019-02.com.gscaifu:disk05 [root@king01 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk01 --login Logging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk01, portal: 192.168.1.203,3260] (multiple) Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk01, portal: 192.168.1.203,3260] successful. [root@king01 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk02 --login Logging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk02, portal: 192.168.1.203,3260] (multiple) Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk02, portal: 192.168.1.203,3260] successful. [root@king01 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk03 --login Logging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk03, portal: 192.168.1.203,3260] (multiple) Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk03, portal: 192.168.1.203,3260] successful. [root@king01 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk04 --login Logging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk04, portal: 192.168.1.203,3260] (multiple) Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk04, portal: 192.168.1.203,3260] successful. [root@king01 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk05 --login Logging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk05, portal: 192.168.1.203,3260] (multiple) Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk05, portal: 192.168.1.203,3260] successful.
标签:02,gscaifu,iSCSI,192.168,3260,Linux,com,iqn.2019 来源: https://blog.51cto.com/13598811/2355906