1 , two servers each configuration two network cards
Store:
Eth0:192.168.1.20/24
Eth1:192.168.2.20/24
Node:
Eth0:192.168.1.10/24
Eth1:192.168.2.10/24
2 , Storage server configuration Targert
# vim/etc/tgt/targets.conf
<target iqn.2016-02.cn.tedu.tech:sata>
Backing-store/dev/sdb1
Initiator-address 192.168.1.10
Initiator-address 192.168.2.10
</target>
# Service TGTD Restart
# Chkconfig TGTD on
3 , discovering storage on the node
# Iscsiadm--mode Discovery--type sendtargets--portal 192.168.1.20--discover
# Iscsiadm--mode Discovery--type sendtargets--portal 192.168.2.20--discover
# Service iSCSI Restart
# chkconfig iSCSI on for automatic Login shared storage
# chkconfig Iscsid on Daemon Process
now through lsblk command, you can see two more hard drives on your host. Essentially, these two hard disks are stored on the same space.
4 , through multipath Multi-path configuration, two hard drives are configured with additional names Mpatha , using Mpatha , you can automatically use SDB or SDC .
Installing on a node multipath Software
# yum Install-y Device-mapper-multipath
Build configuration file
# mpathconf--user_friendly_names N
Editing a configuration file
# vim/etc/multipath.conf
will be Defaults section changes to the following content:
Defaults {
User_friendly_names No
getuid_callout "/lib/udev/scsi_id--whitelisted--device=/dev/%n"
}
Add at the end of the file:
multipaths {
multipath {
Wwid "1IET 00010001"
Alias Mpatha
}
}
5 , start the service
#/ETC/INIT.D/MULTIPATHD Start
# Chkconfig MULTIPATHD on
6 , view /dev/mapper directory, new device files will appear in this directory Mpatha
7 , Mpatha is the shared disk, which can be partitioned
# Fdisk-cu/dev/mapper/mpatha
partition, the first name is called a Mpathap1 , it can be directly mounted using the
# mount/dev/mapper/mpathap1/mnt
8 , loading multipath information
# MULTIPATH-RR
Linux storage technology and applications: Multipath multipath