multipath多路径实验02(2)

Dependency Installed:
  device-mapper-multipath-libs.x86_64 0:0.4.9-72.el6                                                             

Complete!

如果不方便配置yum,也可以直接rpm安装这两个包:
[root@jyrac2 Packages]# rpm -ivh device-mapper-multipath-libs-0.4.9-72.el6.x86_64.rpm
warning: device-mapper-multipath-libs-0.4.9-72.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
  1:device-mapper-multipath########################################### [100%]
[root@jyrac2 Packages]# rpm -ivh device-mapper-multipath-0.4.9-72.el6.x86_64.rpm
warning: device-mapper-multipath-0.4.9-72.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
  1:device-mapper-multipath########################################### [100%]

2.设置服务开机启动

查询当前开机自启用设置:
chkconfig --list|grep multipathd

确认内核成功加载:
modprobe -l |grep multipath   

确认开启开机自启动:
[root@jyrac1 ~]# chkconfig multipathd on
[root@jyrac1 ~]# chkconfig --list|grep multipathd
multipathd      0:off  1:off  2:on    3:on    4:on    5:on    6:off

3.生成multipath配置文件

生成multipath配置文件:
/sbin/mpathconf  --enable

确认服务状态:
service multipathd status

4.multipath的常用命令

常用命令:
--生成multipath配置文件
/sbin/mpathconf --enable

--显示多路径的布局
multipath -ll

--重新刷取
multipath -v2

--清空所有多路径
multipath -F

针对上述常用命令,实际操作的记录,供参考:
[root@jyrac1 ~]# multipath -ll
Jul 18 15:57:18 | DM multipath kernel driver not loaded
Jul 18 15:57:18 | /etc/multipath.conf does not exist, blacklisting all devices.
Jul 18 15:57:18 | A sample multipath.conf file is located at
Jul 18 15:57:18 | /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf
Jul 18 15:57:18 | You can run /sbin/mpathconf to create or modify /etc/multipath.conf
Jul 18 15:57:18 | DM multipath kernel driver not loaded
[root@jyrac1 ~]# chkconfig --list|grep multipathd
multipathd      0:off  1:off  2:off  3:off  4:off  5:off  6:off
[root@jyrac1 ~]# modprobe -l |grep multipath 
kernel/drivers/md/dm-multipath.ko
[root@jyrac1 ~]# service multipathd status
multipathd is stopped
[root@jyrac1 ~]# service multipathd start
Starting multipathd daemon: [  OK  ]
[root@jyrac1 ~]# multipath -ll
Jul 18 15:59:00 | /etc/multipath.conf does not exist, blacklisting all devices.
Jul 18 15:59:00 | A sample multipath.conf file is located at
Jul 18 15:59:00 | /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf
Jul 18 15:59:00 | You can run /sbin/mpathconf to create or modify /etc/multipath.conf
[root@jyrac1 ~]# /sbin/mpathconf --enable

[root@jyrac1 ~]# multipath -v2
Jul 18 16:02:52 | mpatha: ignoring map
Jul 18 16:02:52 | mpathb: ignoring map
Jul 18 16:02:52 | mpathc: ignoring map
Jul 18 16:02:52 | mpathd: ignoring map
Jul 18 16:02:52 | mpathe: ignoring map
Jul 18 16:02:52 | mpathf: ignoring map
create: mpathg (1IET    00010001) undef IET,VIRTUAL-DISK
size=10G features='0' hwhandler='0' wp=undef
|-+- policy='round-robin 0' prio=1 status=undef
| `- 10:0:0:1 sdi 8:128 undef ready  running
`-+- policy='round-robin 0' prio=1 status=undef
  `- 11:0:0:1 sdj 8:144 undef ready  running
[root@jyrac1 ~]# multipath -ll
mpathg (1IET    00010001) dm-2 IET,VIRTUAL-DISK
size=10G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=active
| `- 10:0:0:1 sdi 8:128 active ready  running
`-+- policy='round-robin 0' prio=1 status=enabled
  `- 11:0:0:1 sdj 8:144 active ready  running
[root@jyrac1 ~]#

这里测试没有问题后,为了后续方便测试ASM磁盘组,在iSCSI服务端又分了一个10g的lv,模拟存储端分出的一个LUN,最后在这边就应该有两个多路径聚合盘了。同样的方法在RAC的另一个节点也都配置好。

5.udev绑定权限

我这里系统是RHEL6.5,对于multipath的权限,手工去修改几秒后会变回root。所以需要使用udev去绑定好权限。
 搜索对应的配置文件模板:
[root@jyrac1 ~]# find / -name 12-*
/usr/share/doc/device-mapper-1.02.79/12-dm-permissions.rules

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/12419.html