iSCSI Disk Services for Linux

Source: Internet
Author: User

I. Introduction to iSCSI

ISCSI (Internet SCSI) supports sending SCSI commands to SCSI storage devices (targets) on remote servers from the client (initiator) via IP. The iSCSI qualified name is used to determine the initiator and target, and to use IQN.YYYY.MM. {Reverse Domain}:label format.}

By default, network traffic is clear text to the 3260/TCP on the iSCSI target.

·· iSCSI Initiator: Clients that need access to raw SAN storage

·· iSCSI Target: A remote hard disk that is provided from an iSCSI server, or a "target portal"

·· iSCSI Target Portal: The server that provides the target to the initiator through the network

·· IQN: "iSCSI qualified name". Each initiator and target requires a unique name to identify, and the best practice is to use a name that may be unique on the Internet.


Two. Setting up iSCSI shared devices

Service side:

1. Server modification hostname hostnamectl set-hostname iscsi-server.example.com

Set IP address to 172.25.254.128, turn off firewall

2. Add a new 5GB hard disk/DEV/VDB1 on the server and synchronize the partition list

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/9E/C2/wKioL1mVmrDivxNRAAApy9EXzZg089.png "style=" float : none; "title=" screenshot from 2017-08-17 09-48-03.png "alt=" Wkiol1mvmrdivxnraaapy9exzzg089.png "/>

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/9E/C2/wKioL1mVmrHC042oAAF3RY1HOTI410.png "style=" float : none; "title=" screenshot from 2017-08-17 09-49-13.png "alt=" Wkiol1mvmrhc042oaaf3ry1hoti410.png "/>



3: Install the iSCSI target Interactive Configuration service TARGETCLI

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/00/12/wKiom1mVmrOBuQumAAAwbINh7wE231.png "style=" float : none; "title=" screenshot from 2017-08-17 09-50-26.png "alt=" Wkiom1mvmrobuqumaaawbinh7we231.png "/>


4. Start the TARGETCLI service

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/00/12/wKiom1mVmrOSrOY8AAD9wOpwL8A228.png "style=" float : none; "title=" screenshot from 2017-08-17 09-51-29.png "alt=" Wkiom1mvmrosroy8aad9wopwl8a228.png "/>


5.targetcli entering iSCSI target Interactive configuration mode

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9E/C2/wKioL1mVnWLQDXurAAIHhZBdszs226.png "title=" Screenshot from 2017-08-17 10-01-19.png "alt=" Wkiol1mvnwlqdxuraaihhzbdszs226.png "/>


6.exit Complete service-side configuration


Client:

1. Client modifies hostname hostnamectl Set-hostname iscsi-client.example.com
Set IP address to 172.25.254.228, turn off firewall


2. Installing the iSCSI Client

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/00/13/wKiom1mVnk2xamzaAAAtI-0v4vs892.png "style=" float : none; "title=" screenshot from 2017-08-17 10-04-56.png "alt=" Wkiom1mvnk2xamzaaaati-0v4vs892.png "/>


3. Set the initiator iqn VIM/ETC/ISCSI/INITIATORNAME.ISCSI

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9E/C2/wKioL1mVnkyzdwVNAAA9NUwEqEQ843.png "style=" float : none; "title=" screenshot from 2017-08-17 10-07-10.png "alt=" Wkiol1mvnkyzdwvnaaa9nuweqeq843.png "/>


4. Restart the iSCSI service


650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/00/13/wKiom1mVn-XAqyMbAAB0OzqtW14245.png "style=" float : none; "title=" 1. png "alt=" Wkiom1mvn-xaqymbaab0ozqtw14245.png "/>


650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9E/C2/wKioL1mVn-Sh75yXAAAuiFtRyug944.png "style=" float : none; "title=" 2.png "alt=" Wkiol1mvn-sh75yxaaauiftryug944.png "/>

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/00/13/wKiom1mVn-aDFtZuAAB6IGAeNX0570.png "style=" float : none; "title=" 3.png "alt=" Wkiom1mvn-adftzuaab6igaenx0570.png "/>


650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/9E/C2/wKioL1mVnk2xZ-RjAABkpiWNMH4919.png "style=" float : none; "title=" screenshot from 2017-08-17 10-11-02.png "alt=" Wkiol1mvnk2xz-rjaabkpiwnmh4919.png "/>

5. Partitioning

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/00/13/wKiom1mVnk_S-dqaAAEBZuaAi5Q202.png "style=" float : none; "title=" screenshot from 2017-08-17 10-16-13.png "alt=" Wkiom1mvnk_s-dqaaaebzuaai5q202.png "/>




6. Format and Mount

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/00/13/wKiom1mVnlDjDEz4AAGjf0BSwcQ674.png "style=" float : none; "title=" screenshot from 2017-08-17 10-17-28.png "alt=" Wkiom1mvnldjdez4aagjf0bswcq674.png "/>


7. Remove iSCSI Shared devices


Client:

umount/mnt/

Iscsiadm-m node-t iqn.2017-06.com.example:storeage1-p 172.25.254.128-u

Log out of iSCSI targets and temporarily disconnect

Iscsiadm-m node-t iqn.2017-06.com.example:storeage1-p 172.25.254.128-o Delete

Delete local records for iSCSI targets to permanently disconnect

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/00/13/wKiom1mVobugC4K2AAC28wKdfCM314.png "style=" float : none; "title=" screenshot from 2017-08-17 10-53-03.png "alt=" Wkiom1mvobugc4k2aac28wkdfcm314.png "/>


Service side:

Targetcli

Clearconfig Confirm=true Clear All configuration information for iSCSI

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/9E/C2/wKioL1mVobvh_XPfAAEVijl5A2E804.png "style=" float : none; "title=" screenshot from 2017-08-17 10-55-08.png "alt=" Wkiol1mvobvh_xpfaaevijl5a2e804.png "/>


Three. Setting up iSCSI LVM shared devices


1. Build the previous/DEV/VDB1 partition into the VG partition ISCSIVG

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/9E/C2/wKioL1mVojOiniZAAAE59qjbMCc056.png "style=" float : none; "title=" screenshot from 2017-08-17 11-17-43.png "alt=" Wkiol1mvojoinizaaae59qjbmcc056.png "/>


2. Create all ISCSIVG into Lv0

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/00/13/wKiom1mVo_WAQ6BEAAB7cVrih4Q597.png "title=" Screenshot from 2017-08-17 22-10-41.png "alt=" Wkiom1mvo_waq6beaab7cvrih4q597.png "/>


3.targetcli entering iSCSI target Interactive configuration mode

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9E/C2/wKioL1mVojSQYDy3AAD60oShQ0w043.png "style=" float : none; "title=" screenshot from 2017-08-17 11-26-20.png "alt=" Wkiol1mvojsqydy3aad60oshq0w043.png "/>

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/00/13/wKiom1mVojbjogdIAABadRcbwXk718.png "style=" float : none; "title=" screenshot from 2017-08-17 11-26-40.png "alt=" Wkiom1mvojbjogdiaabadrcbwxk718.png "/>

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/9E/C2/wKioL1mVojbT27zhAACfBi1W3rA239.png "style=" float : none; "title=" screenshot from 2017-08-17 11-27-41.png "alt=" Wkiol1mvojbt27zhaacfbi1w3ra239.png "/>



Log on to an iSCSI target on the server

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/00/13/wKiom1mVojjidw0PAACLx6BQTdw587.png "style=" float : none; "title=" screenshot from 2017-08-17 11-35-08.png "alt=" Wkiom1mvojjidw0paaclx6bqtdw587.png "/>

To see the new device/DEV/SDA

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/00/13/wKiom1mVojmCID8JAAIoA0OcfBI983.png "style=" float : none; "title=" screenshot from 2017-08-17 12-31-35.png "alt=" Wkiom1mvojmcid8jaaioa0ocfbi983.png "/>


Add a new 1GB hard disk/DEV/VDB2 on the server side to modify the partition to LVM

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/00/13/wKiom1mVojjR7wx6AADKQ46E4YQ629.png "style=" float : none; "title=" screenshot from 2017-08-17 11-41-13.png "alt=" Wkiom1mvojjr7wx6aadkq46e4yq629.png "/>

Synchronizing a partition list

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/9E/C2/wKioL1mVojfwUFLAAADRxwoOt-k708.png "style=" float : none; "title=" screenshot from 2017-08-17 11-42-00.png "alt=" Wkiol1mvojfwuflaaadrxwoot-k708.png "/>


Increase the VG of 1GB and increase the LV to 5500M

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/9E/C3/wKioL1mVojmQOIWkAAF0gchGA6Y380.png "style=" float : none; "title=" screenshot from 2017-08-17 12-41-49.png "alt=" Wkiol1mvojmqoiwkaaf0gchga6y380.png "/>


Cancel an iSCSI target on the add server

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/9E/C3/wKioL1mVojmhZqK_AACLODQsO7g067.png "style=" float : none; "title=" screenshot from 2017-08-17 12-42-23.png "alt=" Wkiol1mvojmhzqk_aaclodqso7g067.png "/>

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/00/13/wKiom1mVojvRsH4LAABJOZMuTak789.png "style=" float : none; "title=" screenshot from 2017-08-17 12-42-55.png "alt=" Wkiom1mvojvrsh4laabjozmutak789.png "/>

View new device/DEV/SDA size increased to 5757M

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/9E/C3/wKioL1mVojrjIn2VAAImr3qQ1rI947.png "style=" float : none; "title=" screenshot from 2017-08-17 12-43-43.png "alt=" Wkiol1mvojrjin2vaaimr3qq1ri947.png "/>



iSCSI Disk Services for Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.