multipath与asm设备绑定

Oracle · newbie_l · 于 1年前发布 · 1899 次阅读

云吞信息-风轻云淡

对于Oracle11g,在linux6.x以下的环境中我们可以通过multipath.conf来控制mapper下设备的权限以及属组。但是在linux6.x的环境中/dev/mapper下的设备修改权限和属组后无法直观显示变化,需要通过udev来控制dm-*设备的权限。下面我们一步步介绍下multipath的绑定。

1.multipath安装需要的包:

[root@oel5~]# rpm -qa|grep mapper 
device-mapper-multipath-libs-0.4.9-23.0.9.el5
device-mapper-multipath-0.4.9-23.0.9.el5
device-mapper-event-1.02.67-2.el5
device-mapper-1.02.67-2.el5
device-mapper-1.02.67-2.el5

2.获取磁盘wwid值:

linux6.x以上: 
[root@oel65~]# /sbin/scsi_id -g -u /dev/sdb 
36000c29b88d542cc19f7515a6e512c27

3.通过获得的wwid创建/etc/multipath.conf

[root@rac1 dev]# vi/etc/multipath.conf 
defaults { 
user_friendly_names yes 
queue_without_daemon no
flush_on_last_del yes 
max_fds max 
} 
blacklist { 
devnode "^hd[a-z]" 
devnode"^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*" 
devnode "^cciss.*" 
}
devices { 
device { 
vendor"OPNFILER " 
product"LUN" 
path_grouping_policygroup_by_prio 
features"3 queue_if_no_path pg_init_retries 50" 
getuid_callout"/sbin/scsi_id -g -u -s 
/block/%n"
path_checkertur
path_selector"round-robin 0" 
hardware_handler"1 alua" 
failbackimmediate 
rr_weightuniform
rr_min_io 128 
} 
}
multipaths { 
multipath { 
wwid 
36000c299c8c87dbfb86971c1f1e74f99
alias     data01
uid        500 
gid        200 
mode       0660 
} 
multipath { 
wwid 
36000c297798fcfde2fcfbc9d87b3d0fe
Alias data02 
uid        500 
gid        200 
mode       0660 
} 
multipath { 
wwid
36000c29687c98815127686a54e4a6d43
alias       data03
uid        500 
gid        200 
mode       0660
} 
}

4.在udev配置文件添加修改磁盘属组及权限修改文件

vi /etc/udev/rules.d/99-diskownership.rules
PROGRAM="/bin/chownoracle:oinstall /dev/mapper/data01" 
PROGRAM="/bin/chmod 660/dev/mapper/data01" 
PROGRAM="/bin/chownoracle:oinstall /dev/mapper/data02" 
PROGRAM="/bin/chmod 660/dev/mapper/data02" 
PROGRAM="/bin/chownoracle:oinstall /dev/mapper/data03" 
PROGRAM="/bin/chmod 660/dev/mapper/data03"

5.运行start_udev并将start_udev加入开机启动文件

#start_udev 
Starting udev: [ OK ] 
vi /etc/rc.local start_udev

6.启动multipath服务:

[root@rac1 dev]# modprobe dm-multipath 
[root@rac1 dev]# modprobe dm-round-robin 
[root@rac1 dev]# chkconfig multipathd on
[root@rac1 dev]# servicemultipathd start 
Starting multipathd daemon: [OK ] 
[root@rac1 dev]# multipath -F 
[root@rac1 dev]# multipath -v2
create: data01(36000c299c8c87dbfb86971c1f1e74f99) undef 
VMware,,VMware Virtual S 
size=1.0G features='0'hwhandler='0' wp=undef 
`-+- policy='round-robin 0'prio=1 status=undef 
`- 0:0:1:0 sdb 8:16 undef ready running 
create: data03(36000c29687c98815127686a54e4a6d43) undef VMware,,
VMware Virtual S 
size=1.0G features='0'hwhandler='0' wp=undef 
`-+- policy='round-robin 0'prio=1 status=undef 
`- 0:0:2:0 sdc 8:32 undef ready running 
create: data02(36000c297798fcfde2fcfbc9d87b3d0fe) undef VMware,,
VMware Virtual S 
size=1.0G features='0'hwhandler='0' wp=undef 
`-+- policy='round-robin 0'prio=1 status=undef 
`- 0:0:3:0 sdd 8:48 undef ready running
如发现权限有误,则可修改multipath.conf文件后执行以下操作
multipath –F 
multipath –v2

至此绑定完成。


本帖已经被管理员设置为: 精华帖 !
共收到 0 条回复
没有找到数据。
回复本帖 (需要登录)