Linux安全网 - Linux操作系统_Linux 命令_Linux教程_Linux黑客

会员投稿 投稿指南 本期推荐: 强烈推荐:Ylmf OS 3.0 正式版发布附迅雷高 XP系统下硬盘安装Fedora 14图文教程
搜索:
您的位置: Linux安全网 > Linux入门 > » 正文

Linux多路径的使用及介绍(三)

来源: 霏霏杨柳 分享至:

 多路径,理论上看起来复杂,但是具体到应用/设定,很简单:

1. 安装多路径软件包;
device-mapper-1.02.13xxx.rpm,该软件运行在底层,主要进行设备虚拟化和映射(系统已经自动安装)。
device-mapper-multipath-0.4.7xxx.rpm ,此软件包RHEL5默认已经安装;

2. 安装FC HBA 驱动; 当前的新版Linux已经自带多数FC HBA驱动;
    此时如果需要安装官方驱动,比如安装HP提供的 HP 81E HBA驱动,需要注意其说明内指定的支持OS版本范围;虽然RHEL5.7已经发布,但是HP的驱动仅仅支持到RHEL5.6 , 强行安装的话,只会导致报错甚至系统崩溃;

3. 更新/etc/multipath.conf 设定文件, 可参考后续第六步;

4. 设定multipathd 服务自动启动并初始化;
    chkconfig multipathd on
    multipath -F
    multipath -v2

5. mulitpath -ll ,  看到下列类似输入,表示已经成功!
mpath0 (36001438005dee7fd0000500000a00000) dm-2 HP,HSV400
[size=500G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=200][active]
 \_ 2:0:3:1 sdb 8:16  [active][ready]
 \_ 2:0:6:1 sdc 8:32  [active][ready]
 \_ 3:0:3:1 sdf 8:80  [active][ready]
 \_ 3:0:7:1 sdh 8:112 [active][ready]
\_ round-robin 0 [prio=40][enabled]
 \_ 2:0:2:1 sda 8:0   [active][ready]
 \_ 2:0:7:1 sdd 8:48  [active][ready]
 \_ 3:0:1:1 sde 8:64  [active][ready]
 \_ 3:0:5:1 sdg 8:96  [active][ready]
6. 以下为HP提供的 HPDMmultipath-4.4.1.tar.gz 所提供的 multipath.conf 文件,供参考; 该软件包貌似可以不需要安装:

### Donot edit the first two lines of this file or remove this file
### HP Device Mapper Multipath Enablement Kit v4.4.1

### The Device Mapper Multipath Template configuration file for RHEL5U4
### or later releases to be used with HP Storageworks Arrays.

### Use this configuration file as your /etc/multipath.conf file.
### If you already have a valid working configuration file, refer here 
### for the recommended configuration for HP arrays.

### For a list of configuration options with descriptions, please refer 
### to /usr/share/doc/<multipath-tools-version>/multipath.conf.annotated 

# The defaults section 
defaults {
    udev_dir        /dev
    polling_interval    10
    selector        "round-robin 0"
    path_grouping_policy    failover
    getuid_callout        "/sbin/scsi_id -g -u -s /block/%n"
    prio_callout        "/bin/true"
    path_checker        tur
    rr_min_io        100
    rr_weight           uniform
    failback        immediate
    no_path_retry        12
    user_friendly_names    yes
}

# The blacklist section - use this to blacklist a multipath device based on 
# it's wwid ( using wwid ) or device names ( using devnode ) or
# vendor and product id ( using device block).

blacklist {
#    wwid        26353900f02796769
    devnode        "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
    devnode     "^hd[a-z][[0-9]*]"
#    devnode        "^cciss!c[0-9]d[0-9]*"
#    device {
#        vendor "HP"
#        product    "OPEN-*"
#    }
}

# The blacklist_exceptions section - to list device names to be treated 
# as multipath candidates even if they are on the blacklist.

# Note: blacklist exceptions are only valid in the same class.
#       It is not possible to blacklist devices using the devnode keyword
#       and to exclude some devices of them using the wwid keyword.

#blacklist_exceptions {
#    wwid        2345234245647657
#    devnode        "sda"
#    device {
#        vendor    "HP"
#        product    "OPEN-*"
#    }
#}

# The multipaths section - uncomment this section to define a per multipath
# device settings.
#multipaths {
# uncomment the multipath block to modify the settings of a multipath device
# based on its wwid

#multipath {
#    wwid            2039485769900000000
#    alias            red
#    path_grouping_policy    group_by_prio
#    path_selector        "round-robin 0"
#    failback        immediate
#    rr_weight        uniform    
#    no_path_retry        10
#    rr_min_io        100
#}

#}

# The devices section - used to define per storage array model settings
devices {

# If you are already using a valid configuration file and do not have a 
# device subsection for HP arrays, please add the appropriate device subsection 
# for the respective arrays from the entries below.
# If you already have a device subsection for HP arrays which has different 
# parameters from the entries below, modify it appropriately.

# For EVA A/A arrays

device {
    vendor            "HP|COMPAQ"
    product         "HSV1[01]1 \(C\)COMPAQ|HSV2[01]0|HSV300|HSV4[05]0"
    path_grouping_policy    group_by_prio
        getuid_callout        "/sbin/scsi_id -g -u -s /block/%n"
        path_checker        tur
        path_selector        "round-robin 0"
        prio_callout        "/sbin/mpath_prio_alua /dev/%n"
        rr_weight        uniform
        failback        immediate
    hardware_handler    "0"
        no_path_retry        18
    rr_min_io        100
}

# For HP P2000 family 
device {
        vendor                  "HP"
        product                 "P2000 G3 FC|P2000G3 FC/iSCSI"
        path_grouping_policy    group_by_prio
        getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
        path_checker            tur
        path_selector           "round-robin 0"
        prio_callout            "/sbin/mpath_prio_alua /dev/%n"
        rr_weight               uniform
        failback                immediate
        hardware_handler        "0"
        no_path_retry           18
        rr_min_io               100
}
# For XP arrays
device {
        vendor            "HP"
        product            "OPEN-.*"
        path_grouping_policy    multibus
        getuid_callout        "/sbin/scsi_id -g -u -s /block/%n"
    path_selector        "round-robin 0"
        rr_weight        uniform
        path_checker        tur
    hardware_handler    "0"
        failback        immediate
        no_path_retry        18
    rr_min_io        1000
}
# For MSA A/A arrays
device {
        vendor                  "HP"
        product                 "MSA VOLUME*"
        path_grouping_policy    group_by_prio
        getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
        path_checker            tur
        path_selector           "round-robin 0"
        prio_callout            "/sbin/mpath_prio_alua /dev/%n"
        rr_weight               uniform
        failback                immediate
        hardware_handler        "0"
        no_path_retry           18
        rr_min_io               100
}

# For MSA2xxxsa arrays
device {
        vendor                  "HP"
        product                 "MSA2012sa|MSA2312sa|MSA2324sa"
        path_grouping_policy    group_by_prio
        getuid_callout          "/sbin/scsi_id -g -u -n -s /block/%n"
        path_checker            tur
        path_selector           "round-robin 0"
        prio_callout            "/sbin/mpath_prio_alua %d"
        rr_weight               uniform
        failback                immediate
        hardware_handler        "0"
        no_path_retry           18
        rr_min_io               100
}
# For MSA23xxfc and MSA23xxi arrays
device {
        vendor                  "HP"
        product                 "MSA2312fc|MSA2324fc|MSA2312i|MSA2324i"
        path_grouping_policy    group_by_prio
        getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
        path_checker            tur
        path_selector           "round-robin 0"
        prio_callout            "/sbin/mpath_prio_alua /dev/%n"
        rr_weight               uniform
        failback                immediate
        hardware_handler        "0"
        no_path_retry           18
        rr_min_io               100
}
# For MSA20xxfc, MSA22xxfc and MSA20xxi arrays
device {
        vendor            "HP"
        product            "MSA2[02]12fc|MSA2012i"
        path_grouping_policy    multibus
        getuid_callout        "/sbin/scsi_id -g -u -s /block/%n"
    path_selector        "round-robin 0"
        rr_weight        uniform
        path_checker        tur
    hardware_handler    "0"
        failback        immediate
        no_path_retry        18
    rr_min_io        100
}
# To blacklist a device by vendor and product say, to blacklist a XP device 
# uncomment the below block

#device {
#    vendor            "HP"
#    product_blacklist    "OPEN-.*"
#}
}


Tags:
分享至:
最新图文资讯
1 2 3 4 5 6
验证码:点击我更换图片 理智评论文明上网,拒绝恶意谩骂 用户名:
关于我们 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 发展历史