Linux 配置多路径步骤

1、安装多路径软件包:
[root@flash Packages]# ls device-mapper*
device-mapper-1.02.77-9.el6.x86_64.rpm             device-mapper-libs-1.02.77-9.el6.x86_64.rpm
device-mapper-event-1.02.77-9.el6.x86_64.rpm       device-mapper-multipath-0.4.9-64.el6.x86_64.rpm
device-mapper-event-libs-1.02.77-9.el6.i686.rpm    device-mapper-multipath-libs-0.4.9-64.el6.i686.rpm
device-mapper-event-libs-1.02.77-9.el6.x86_64.rpm  device-mapper-multipath-libs-0.4.9-64.el6.x86_64.rpm
device-mapper-libs-1.02.77-9.el6.i686.rpm          device-mapper-persistent-data-0.1.4-1.el6.x86_64.rpm
[root@flash Packages]# rpm -ivh device-mapper-1.02.77-9.el6.x86_64.rpm
warning: device-mapper-1.02.77-9.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
        package device-mapper-1.02.77-9.el6.x86_64 is already installed
[root@flash Packages]# rpm -ivh device-mapper-event-1.02.77-9.el6.x86_64.rpm
warning: device-mapper-event-1.02.77-9.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
        package device-mapper-event-1.02.77-9.el6.x86_64 is already installed
[root@flash Packages]# rpm -ivh device-mapper-multipath-0.4.9-64.el6.x86_64.rpm
warning: device-mapper-multipath-0.4.9-64.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
error: Failed dependencies:
        device-mapper-multipath-libs = 0.4.9-64.el6 is needed by device-mapper-multipath-0.4.9-64.el6.x86_64
        libmpathpersist.so.0()(64bit) is needed by device-mapper-multipath-0.4.9-64.el6.x86_64
        libmultipath.so()(64bit) is needed by device-mapper-multipath-0.4.9-64.el6.x86_64
[root@flash Packages]# rpm -ivh device-mapper-multipath-libs-0.4.9-64.el6.x86_64.rpm
warning: device-mapper-multipath-libs-0.4.9-64.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:device-mapper-multipath########################################### [100%]
[root@flash Packages]# rpm -ivh device-mapper-multipath-0.4.9-64.el6.x86_64.rpm
warning: device-mapper-multipath-0.4.9-64.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:device-mapper-multipath########################################### [100%]
[root@flash Packages]#

2、设置开机启动,并检查安装包是否正常:
[root@flash Packages]# /etc/init.d/multipathd start
Starting multipathd daemon: [  OK  ]
[root@flash Packages]# chkconfig multipathd on
[root@flash Packages]# chkconfig --level 345 multipathd on
[root@flash Packages]# chkconfig --list multipathd
multipathd      0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@flash Packages]# multipath -ll
Nov 30 20:38:45 | /etc/multipath.conf does not exist, blacklisting all devices.
Nov 30 20:38:45 | A sample multipath.conf file is located at
Nov 30 20:38:45 | /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf
Nov 30 20:38:45 | You can run /sbin/mpathconf to create or modify /etc/multipath.conf
[root@flash Packages]# /sbin/mpathconf
multipath is enabled
find_multipaths is disabled
user_friendly_names is enabled
dm_multipath module is loaded
multipathd is chkconfiged on
[root@flash Packages]# multipath -ll
Nov 30 20:39:13 | /etc/multipath.conf does not exist, blacklisting all devices.
Nov 30 20:39:13 | A sample multipath.conf file is located at
Nov 30 20:39:13 | /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf
Nov 30 20:39:13 | You can run /sbin/mpathconf to create or modify /etc/multipath.conf
[root@flash Packages]# cp  /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf /etc/multipath.conf
[root@flash Packages]# multipath -ll
[root@flash Packages]# multipath -v2
[root@RKDB01 Server]# modprobe dm-multipath 
[root@RKDB01 Server]# multipath -F 
[root@RKDB01 Server]# multipath dm-multipath 
[root@RKDB01 Server]# multipath dm-round-robin 
[root@RKDB01 Server]# service multipathd restart 
[root@flash ~]# cd /etc/multipath
[root@flash multipath]# ll
total 8
-rw-------. 1 root root 364 Nov 30 23:38 bindings
-rw-------. 1 root root 298 Nov 30 23:38 wwids
[root@flash multipath]# cat bindings
# Multipath bindings, Version : 1.0
# NOTE: this file is automatically maintained by the multipath program.
# You should not need to edit this file in normal circumstances.
#
# Format:
# alias wwid
#
mpatha 3600507605810dab81c07600e2c19b4d1
mpathb 3600507680c80804ab800000000000075
mpathc 3600507680c80804ab800000000000074
mpathd 3600507680c80804ab800000000000073
[root@flash multipath]# cat wwids
# Multipath wwids, Version : 1.0
# NOTE: This file is automatically maintained by multipath and multipathd.
# You should not need to edit this file in normal circumstances.
#
# Valid WWIDs:
/3600507680c80804ab800000000000075/
/3600507680c80804ab800000000000074/
/3600507680c80804ab800000000000073/
[root@flash multipath]# multipath -ll
Dec 01 00:10:52 | sdh: couln't get asymmetric access state
Dec 01 00:10:52 | sde: couln't get asymmetric access state
mpathd (3600507680c80804ab800000000000073) dm-2 IBM,2145
size=500G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=24 status=active
| |- 1:0:0:0 sdb 8:16  active ready running
| `- 0:0:0:0 sdh 8:112 active ready running
`-+- policy='round-robin 0' prio=4 status=enabled
  |- 1:0:1:0 sde 8:64  active ready running
  `- 0:0:1:0 sdk 8:160 active ready running
mpathc (3600507680c80804ab800000000000074) dm-1 IBM,2145
size=2.0T features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| `- 1:0:1:1 sdf 8:80  active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
  `- 1:0:0:1 sdc 8:32  active ready running
mpathb (3600507680c80804ab800000000000075) dm-0 IBM,2145
size=2.0T features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 1:0:0:2 sdd 8:48  active ready running
| `- 0:0:0:2 sdj 8:144 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
  |- 1:0:1:2 sdg 8:96  active ready running
  `- 0:0:1:2 sdm 8:192 active ready running
[root@flash multipath]#
[root@flash multipath]# ll /dev/mapper/ 
total 0
crw-rw----. 1 root root 10, 236 Nov 30 23:18 control
lrwxrwxrwx. 1 root root       7 Nov 30 23:38 mpathb -> ../dm-0
lrwxrwxrwx. 1 root root       7 Nov 30 23:38 mpathc -> ../dm-1
lrwxrwxrwx. 1 root root       7 Dec  1 00:16 mpathd -> ../dm-2
lrwxrwxrwx. 1 root root       7 Dec  1 00:16 mpathdp1 -> ../dm-3
[root@flash multipath]#

你可能感兴趣的:(Linux 配置多路径步骤)