RHEL7.0 ISCSI configuration details

Source: Internet
Author: User

RHEL7.0 ISCSI configuration details

ISCSI remote Block Storage
Introduction
Topics covered in this blog:
ISCSI Concept
Provide iSCSI targets
Access iSCSI Storage

  1. ISCSI Concept

    ISCSI (Internet SCSI) supports sending SCSI commands from the client (initiator) to the SCSI Storage Device (target) on the remote server through an IP address. The iSCSI qualified name is used to determine the initiator and target, and in the format of iqn. yyyy-mm. {reverse domain}: label. By default, network communication is the plain text of port 3260/tcp on the iSCSI target.
    ISCSI initiator: the client that needs to access the original SAN storage.
    ISCSI target: remote hard disk provided by the iSCSI server, or "target Portal"
    ISCSI target Portal: provides the target server to the initiator through the network.
    IQN: "iSCSI qualified name ". Each initiator and target must be identified by a unique name. The best practice is to use a name that may be unique on the Internet.

2. iSCSI target Configuration

Install the iSCSI target software package:
# Yum install-y targetcli
Start the service:
# Systemctl enable target; systemctl start target
Enter the iSCSI target interactive configuration mode:
# Targetcli
Www.bkjia.com
8 Demo
/> Ls
O -/..................................... ................................ [...]
O-backstores ..................................... ..................... [...]
| O-block .................................... .......... [Storage Objects: 0]
| O-fileio .................................... ......... [Storage Objects: 0]
| O-pscsi .................................... .......... [Storage Objects: 0]
| O-ramdisk .................................... ........ [Storage Objects: 0]
O-iscsi ..................................... ................... [Targets: 0]
O-loopback ..................................... ................ [Targets: 0]
/>/Backstores/block create server0.disk1/dev/iSCSI_vg/disk1_lv
Created block storage object server0.disk1 using/dev/iSCSI_vg/disk1_lv.
/>/Iscsi create iqn.2016-09.com. example: server0
Created target iqn.2016-09com. example: server0.
Created TPG 1.
Www.bkjia.com
9/>/iscsi/iqn.2016-09.com. example: server0/tpg1/acls create iqn.2016-09.com. example: Too top0
Created Node ACL for iqn.2016-09.com. example: Keys top0
// Iscsi/iqn.2016-09.com. example: server0/tpg1/luns create/backstores/block/server0.disk1
Created LUN 0.
Created LUN 0-> 0 mapping in node ACL iqn.2016-09.com. example: Comment top0
// Iscsi/iqn.2016-09.com. example: server0/tpg1/portals create 172.25.0.11
Using default IP port 3260
Created network portal 172.25.0.11: 3260.
/> Exit

3. Access iSCSI Storage

Install the iSCSI initiator package:
# Yum install-y iscsi-initiator-utils
Set the initiator IQN in/etc/iscsi/initiatorname. iscsi:
InitiatorName = iqn.2016-09.com. example: Too top0
Find the iSCSI target (target portal) provided by the iSCSI Server)
# Iscsiadm-m discovery-t st-p 172.25.0.11
Log on to one or more iscsi targets on the server
# Iscsiadm-m node-T iqn.2016-09.com. example: server0-p
172.25.0.11-l
Www.bkjia.com
In this case, you can use an iSCSI disk as if it was a local hard drive.
You can mount an existing file system. If the disk is not formatted, You can partition it through fdisk, for example
The file system format the partition or as the physical volume of the LVM.
Mount the file system permanently in/etc/fstab.
1. Use blkid to determine the file system UUID and mount it with UUID instead of the/dev/sd * device name. (Each time
Different device names are displayed during boot, depending on the order in which the iSCSI Device responds over the network.
If the device name is attached, the device is incorrectly used .)
2. Use _ netdev as the mount option in/etc/fstab. (This will ensure that the client will not try to mount the file system
To enable the internet. Otherwise, the system will fail during boot .)
3. Make sure that the iscsi service is started during boot.

ISCSI interruption target
Make sure that no devices provided by the target are used.
Ensure that all permanent mounts of the target are deleted from/etc/fstab and other locations.
Log out of the iSCSI target to temporarily disconnect.
# Iscsiadm-m node-T iqn.2016-09.com. example: rdisks. demo-p 172.25.0.11-u
Delete the local record of the iSCSI target to permanently disconnect the connection.
# Iscsiadm-m node-T iqn.2016-09.com. example: rdisks. demo-p 172.25.0.11-o delete

This article permanently updates link: https://www.bkjia.com/Linux/2018-03/151303.htm

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.