Configuring the server side (storage)
Install TARGETCLI, restart the service
/> lso- / ... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... [...] o- backstores .............................................................. [...]   | O- BLOCK&NBSP, ... Disk ..... [storage objects: 0] | o- fileio ..... .....??????????????. File ..... [storage objects: 0] | o- pscsi ..... .....??????????????.  ......SCSI the disk ... [storage objects: 0] | o-.........-----------. ramdisk ............................. [storage objects: 0] o- iscsi the memory as a hard disk ..... ... [targets: 0] o- loopback. ..... ..... ..... ..... ..... .....??????????????????...  ........................................................ [TARGETS: 0]
CD to block, create a backend storage called back
/> CD backstores/block/backstores/block> Create back/dev/vg0/tiaodai0created block storage object back using/dev/ Vg0/tiaodai0./> CD iscsi/iscsi> Create Wwn=iqn.2015-08.com.example.server0 Created target Iqn.2015-08.com.ex ample.server0.Created TPG 1. #创建一个target, note the naming format. This is returned to the client when the client connects to the server, similar to the name
/iscsi> lso-iscsi ... ..... .... ... .... ..... ..... .... ..... ............................. [Targets:1] O-iqn.2015-08.com.example.server0 .......... ................. [Tpgs:1] o-tpg1 ..... ..... ....... ...................... [No-gen-acls, No-auth] o-acls ..... Access control ..... ..... .................... [acls:0] o-luns ...... What resources are available ......... ............. [luns:0] o-portals ..... What IP is available to provide services ....... ...... [portals:0]
CD to ACLs
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/72/87/wKiom1XlbofRlbw-AADFfqfS130877.jpg "title=" Qq20150901172259.png "alt=" Wkiom1xlbofrlbw-aadffqfs130877.jpg "/>
Only this client has access to the server
/iscsi/iqn.20....server0/tpg1> CD luns/iscsi/iqn.20...er0/tpg1/luns> create/backstores/block/back Created LUN 0. #创建LUN
/iscsi/iqn.20.../tpg1/portals> Create 172.25.0.11Using default IP port 3260Created Network Portal 172.25.0.11:3260.# The business IP port is defined
/> Saveconfig last ten configs saved In/etc/target/backup. Configuration saved To/etc/target/saveconfig.json
Finally, the configuration file remains. Altogether 5 created!
Exit to restart the Target.service service.
Server-side configuration is complete.
PS: Notice the firewall, iptables-f
Client Configuration
If you need to change your name, remember to restart the iSCSI and Iscsid services
VIM/ETC/ISCSI/INITIATORNAME.ISCSI change the name here.
Turn off the iSCSI service after you change your name
[Email protected] iscsi]# cd/var/lib/iscsi/nodes/#把下面的文件删掉! [Email protected] nodes]# cd/var/lib/iscsi/send_targets/#同样删掉! 2 Delete and then open iSCSI Service
# iscsiadm-m Discovery-t st-p 172.25.0.11 #发现主机 # iscsiadm-m Node-l #登陆
The operation is complete.
When mounting this drive, be aware that:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/72/84/wKioL1XlfDCB3zpcAADI1dSHSCk060.jpg "title=" Qq20150901181220.png "alt=" Wkiol1xlfdcb3zpcaadi1dshsck060.jpg "/>
Soft San Classroom Content