Linux iSCSI storage configuration

First, the basics of
1.1, storage-related
direct storage (DAS): such as a disk on the machine, belong to direct storage.
Storage Area Network (SAN): storage devices from other disks within the network provided. Iscsi is part of the way.
Network File System (NAS): Direct provides a file system can be used immediately.

1.2, ISCSI-related basis
iscsi target: end storage devices, server devices, providing "disk" as the other servers.
Iscsi initiator: Use target to provide "disk" of the client.

Two, ISCSI server installation configuration
to 192.168.28.130 as a target, initiator were 192.168.28.131

2.2, installation and configuration target
a, installation package:
SCSI-target-utils
# Perl-Config-General-2.44-1.el6. noarch.rpm

The main configuration file and command:
/etc/tgt/target.conf main configuration file
/ usr / sbin / tgt-admin online query, delete target functions such as command
/ usr / sbin / tgtd main provider of iSCSI target service main

iSCSI corresponding transparent, are several ways to share as "disk" out of initiator used to:
(1) large files [dd] command generator (2) disk array, real disk or other magnetic disk partition (3) using the LVM logical volume

b, start the service
service tgtd start
chkconfig --level 35 tgtd oN

c, use fdisk to create a 500M partition / dev / sdc1, or create an image file on the file system.

d, edit /etc/tgt/target.conf, and the Name Qualified! set the iSCSI (the IQN)
<target iqn.2014-05.com.example: server.target1>
backing-Store / dev / sdc1
Write Cache-ON  # open write cache
Initiator-address 192.168.28.131 # client access control
</ target>
save and launch into effect after the restart the service.

Note start the service: chkconfig tgtd ON
chkconfig iscsi ON
chkconfig iscsid on

view target information: --show TGT ADMIN-

E, of parameters related to
the naming of the SCSI target name:
. iqn.yyyy-mm <the reversed Domain name> [: identifier]
its meaning:
IQN indicates "iSCSI Qualified Name ", referred to iqn. yyyy-mm means "year - month." reversed domain name represents a reverse domain name. identifier is a distinguished name.

Several commonly used parameters are as follows:
backing-Store : virtual device, corresponding to a direct-store (actual equipment), when set, if used to block all of the disk may be used in the configuration using the direct-store, and vice versa use backing-store,

As used herein backing-store, plans to use LVM logical volumes in future production environment, the configuration here should still use the backing-store.

address-initiator : client address, source IP can be used to limit the initiator.

IncomingUser : user name and password, you can set the initiator using the account password before you can use the corresponding target

Three, iSCSI client configuration
3.1 Installing client software package
yum-utils * iscsi-Initiator - the y-

3.2 to start the service and add the boot
Service iscsid Start
chkconfig --level 35 iscsid ON

3.3 found iSCSI server's shared partition
iscsiadm --mode discover the SendTargets --portal 192.168.28.130 --type
the iscsiadm the Discover -m -p -t the SendTargets # server 192.168.28.130 IP

log on to the iSCSI server shared partitions:
the iscsiadm -m -T iqn.2014-05.com.example the Node: server .target1 -p 192.168.28.130 -l
log in successfully
use fdisk -l to see more out of the partition / dev / sdc1

3.4 formatted partition, mount to the local.
To achieve at startup, add records in the fstab, will be to add _netdevc parameters.
If prompted no partition table, fdisk / dev / sdc1 x - w, then create partitions. mkfs.ext4 / dev / sdc1
permanent mount: vim / etc / fstab UUID mount
/ dev / sdc1 / mnt / iscsi ext4 defaults, _netdev 0 0

3.5 Other
at the initiator end of the display target host found:
[[email protected] Test] # the iscsiadm -m Node
192.168.10.1:3260,1 iqn.2013-09.com.inter.10.1: Test target-

disconnect end and initiator connection specified target:
scsiadm -m Node iqn.2013-09.com.inter.10.1: Test target -u-

connected terminal initiator specified target:
the iscsiadm -m Node iqn.2013-09.com.inter.10.1: Test -target -l

display target has been established at the initiator end is connected:
the iscsiadm the session -m



Guess you like

Origin www.cnblogs.com/liuxing0007/p/11442537.html
Recommended