Linux iSCSI Multi-Path Mount storage

Source: Internet
Author: User
Preparation:
creates the LUN, divides the Llun into separate groups, joins the server's IQN information to the LUN
if you put the default group, the hard disk information that is displayed when scanning iSCSI is all LUNs, May result in a false operation.
Scan Storage:
The iSCSI plug-in installs the system when it is checked, if it is not possible to install via local source or Yum
[[email protected]] #service iSCSI Start #启动ISCSI service
[[email protected]] #chkconfig--list | grep iscsi #查看ISCSI服务是否开机启动
[[email  Protected]] #iscsiadm-m discovery-t st-p 192.168.85.101:3260 #扫描存储 St for Sendtargets shorthand
[email protected]]# Iscsiadm-m discovery-t st-p 192.168.85.102:3260 #双链路所以要两次
Format: iscsiadm-m discovery-t st-p Storage IP: Port number br/>[[email protected] ] #reboot
[email protected] ] #iscsiadm-M node-t iqn.1992-01.com.lsi:4981.60080e50002c4a10000000004f6fba42-p 192.168.85.101:3260-l
[ [email protected]]# iscsiadm-m node-t iqn.1992-01.com.lsi:4981.60080e50002c4a10000000004f6fba42-p 192.168.85.101:3260-l
#双链路所以要两次
#fdisk-L #可以看到硬盘信息
Basic configuration of Multipath in Redhat 6.2:

  1. by command: lsmod |grep dm_multipath Check if the installation is successful. If no output instructions are not installed then install the package via the Yum feature: Yum–y install Device-mapper Device-mapper-multipath
    Then through the command: MULTIPATH–LL view multipath status See if the module is loaded successfully
    [[email protected]] #yum –y Install Device-mapper Device-mapper-multipath
    (no installation can be done using a local source, in the absence of a network.) )
    [[email protected]]# multipath–ll View multipath status
    Mar 10 19:18:28 | /etc/multipath.conf does not exist, blacklisting all devices.
    Mar 10 19:18:28 | A Sample multipath.conf file is located at
    Mar 10 19:18:28 | /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf
    Mar 10 19:18:28 | Can run/sbin/mpathconf to create or modify/etc/multipath.conf
    Mar 10 19:18:28 | DM multipath Kernel driver not loaded----DM module not loaded
    If the module does not load successfully use the following to initialize the DM, or restart the system
    ---Use the following commands to initialize and start DM for the first time:
    [[email protected]]# modprobe Dm-multipath
    [[email protected]]# modprobe Dm-round-robin
    [[email protected]]# Service MULTIPATHD Start
    [[email protected]]# Multipath–v2
    After initialization, check whether the load succeeds with the MULTIPATH-LL command
    [[email protected]]# Multipath-ll
    Mar 10 19:21:14 | /etc/multipath.conf does not exist, blacklisting all devices.
    Mar 10 19:21:14 | A Sample multipath.conf file is located at
    Mar 10 19:21:14 | /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf
    Mar 10 19:21:14 | Can run/sbin/mpathconf to create or modify/etc/multipath.conf
    DM multipath Kernel driver not loaded----This hint does not indicate that the DM module has been loaded successfully.
    As you can see from the tips above, the DM module is loaded successfully, but there is no multipath.conf configuration file under/etc/, and the next step is to configure the multipath.conf file.
  2. Configuration multipath:
    To create a multipath configuration file path through the VI command is/ETC/MULTIPATH.CONF, the simplest configuration to add multipath to the configuration file is as follows:
    [[email protected]] #vi/etc/multipath.conf
    Blacklist {
    Devnode "^SDA"
    }
    Defaults {
    User_friendly_names Yes
    Path_grouping_policy Multibus
    failback Immediate
    No_path_retry fail
    }
    Save the configuration when editing is complete, and pass the command:
    [[email protected]]#/ETC/INIT.D/MULTIPATHD Stop
    [[email protected]]#/ETC/INIT.D/MULTIPATHD Start
    [[email protected]]# Multipath-ll
    Mpatha (360a9800064665072443469563477396c) dm-0 Netapp,lun----created a LUN
    size=3.5g features= ' 0 ' hwhandler= ' 0 ' WP=RW
    -+- policy=‘round-robin 0‘ prio=4 status=active<br/>|- 1:0:0:0 sdb 8:16 active ready running ----多路径下的两个盘符sdb和sde.<br/>-2:0:0:0 SDE 8:64 active ready Running
    Directory/dev/mapper/has two more folders Mpatha and Mpathap1.
    [[email protected]]# cd/dev/mapper/
    [[email protected]mapper]# ls
    Control Mpatha Mpathap1
    At the same time the Fdisk–l command also has more than two device identities:
    mapper# fdisk-l
    mapper# multipath-f #删除现有路径 Two new paths will be deleted (no action)
    mapper# multipath-v2 #格式化路径 formatted and then appears (no action)
  3. basic operations for multipath disks
    to operate on disks generated by Multipath software, directly manipulate the disks in the/dev/mapper/directory. It's a good idea to run the pvcreate command before partitioning the disks generated by Multipath software:
    [[email protected] ]# pvcreate/dev/ Mapper/mpatha
    [[email  Protected] ]# Fdisk/dev/mapper/mpatha partition with this directory/dev/mapper/mpatha
    N: Represents the new partition, p: Represents the primary partition, W: Represents the Save exit, set the disk size with + 30000M, when the disk is divided into a partition, enter directly.
    using FDISK to partition the disk generated by the Multipath software will be an error, this error is ignored.
    [[email protected] ]# Ls-l/dev/mapper/
    Mpathap1 is our partition of the multipath disk
    [[email protected] ]# MKFS.EXT4/DEV/MAPPER/MPATHAP1 # Format the MPATH1P1 partition as Ext4 file system
    [[email  protected] ]# mount/dev/mapper/mpathap1/mnt/#挂载mpathap1分区

iSCSI Mount reference files: https://jingyan.baidu.com/article/046a7b3edda53bf9c27fa9a2.html
Multipath Multi-path Reference file: http://www.mamicode.com/info-detail-161176.html

Linux iSCSI Multi-Path Mount storage

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.