udev+multipath配合绑定磁盘

本配置在redhat6.5上做的实施,安装oracle rac 11.2.0.4版本,

一,mulipath 配置文件

[root@oracle2 ~]# more /etc/multipath.conf
blacklist {
   wwid 3600605b009ef05c01e79390f1928e278
   wwid 3600605b009ef05c01e79390f19291075
}
        defaults {
        user_friendly_names             yes
        polling_interval                10
        checker_timeout                 120
        queue_without_daemon            no
        flush_on_last_del               yes
}
devices {
device {
        vendor                          "MacroSAN"
        product                         "LU"
        path_grouping_policy            group_by_prio
        no_path_retry                   queue
        prio                            alua
        getuid_callout                  "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
        path_checker                    tur
        path_selector                   "round-robin 0"
        hardware_handler                 "0"
        failback                        15
        }
}
multipaths{
      multipath{
            wwid 3600b342c5b56044dda8bd7543d0000d4
            alias mpath01
            uid   501
            gid   504
}  
      multipath{
            wwid 3600b3428376c180d494ad3f9ed0000d4
            alias mpath02
            uid   501
            gid   504            
}


二、mulipath 生效后结果
[root@oracle2 ~]# multipath -l |more
mpath23 (3600b34263f92eaed0d09d6243d0000d4) dm-77 MacroSAN,LU
size=600G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=0 status=active
| `- 7:0:0:77 sdcb 68:240  active undef running
`-+- policy='round-robin 0' prio=0 status=enabled
  `- 8:0:0:77 sdfp 130:176 active undef running
mpath38 (3600b342f259a84adce9bd3b65d0000d4) dm-27 MacroSAN,LU
size=600G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=0 status=active
| `- 7:0:0:25 sdab 65:176  active undef running
`-+- policy='round-robin 0' prio=0 status=enabled
  `- 8:0:0:25 sddp 71:112  active undef running
mpath40 (3600b3429a95e3b6dc9dfd7451d0000d4) dm-30 MacroSAN,LU
size=600G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=0 status=active
| `- 7:0:0:31 sdah 66:16   active undef running
`-+- policy='round-robin 0' prio=0 status=enabled
  `- 8:0:0:31 sddv 71:208  active undef running


三、使用udev绑定数组和权限


[root@oracle2 ~]# more /etc/udev/rules.d/99-diskownership.rules


SUBSYSTEM!="block", GOTO="quickexit"
KERNEL!="dm-*", GOTO="quickexit"
PROGRAM=="/sbin/dmsetup info -c --noheadings -o name -m %m -j %M"
RESULT=="*ocr*", OWNER="grid", GROUP="oinstall", MODE="0660"
RESULT=="*mpath*", OWNER="grid", GROUP="oinstall", MODE="0660"
LABEL="quickexit"  
[root@oracle2 ~]# 




[root@oracle2 ~]# start_udev
启动udev服务后,磁盘权限改变


[root@oracle2 mapper]# ll
total 0
crw-rw----. 1 root root 10, 58 Apr 11 14:17 control
lrwxrwxrwx. 1 root root      8 Apr 11 14:19 mpath01 -> ../dm-88
lrwxrwxrwx. 1 root root      8 Apr 11 14:19 mpath02 -> ../dm-34
lrwxrwxrwx. 1 root root      8 Apr 11 14:19 mpath03 -> ../dm-17
lrwxrwxrwx. 1 root root      8 Apr 11 14:19 mpath04 -> ../dm-57
lrwxrwxrwx. 1 root root      8 Apr 11 14:19 mpath05 -> ../dm-72
lrwxrwxrwx. 1 root root      8 Apr 11 14:19 mpath08 -> ../dm-78
lrwxrwxrwx. 1 root root      8 Apr 11 14:19 mpath09 -> ../dm-55
lrwxrwxrwx. 1 root root      8 Apr 11 14:19 mpath10 -> ../dm-15
lrwxrwxrwx. 1 root root      8 Apr 11 14:19 mpath11 -> ../dm-56
lrwxrwxrwx. 1 root root      8 Apr 11 14:19 mpath12 -> ../dm-71
lrwxrwxrwx. 1 root root      8 Apr 11 14:19 mpath15 -> ../dm-76
lrwxrwxrwx. 1 root root      8 Apr 11 14:19 mpath16 -> ../dm-54
lrwxrwxrwx. 1 root root      8 Apr 11 14:19 mpath17 -> ../dm-18
lrwxrwxrwx. 1 root root      8 Apr 11 14:19 mpath19 -> ../dm-58


dm盘的权限改变
[root@oracle2 mapper]# cd ..
[root@oracle2 dev]# ls -l dm-*
brw-rw----. 1 grid oinstall 253,  0 Apr 11 14:25 dm-0
brw-rw----. 1 grid oinstall 253,  1 Apr 11 14:25 dm-1
brw-rw----. 1 grid oinstall 253, 10 Apr 11 14:19 dm-10
brw-rw----. 1 grid oinstall 253, 11 Apr 11 14:19 dm-11
brw-rw----. 1 grid oinstall 253, 12 Apr 11 14:19 dm-12
brw-rw----. 1 grid oinstall 253, 13 Apr 11 14:19 dm-13
brw-rw----. 1 grid oinstall 253, 14 Apr 11 14:19 dm-14
brw-rw----. 1 grid oinstall 253, 15 Apr 11 14:19 dm-15
brw-rw----. 1 grid oinstall 253, 16 Apr 11 14:19 dm-16
brw-rw----. 1 grid oinstall 253, 17 Apr 11 14:19 dm-17
brw-rw----. 1 grid oinstall 253, 18 Apr 11 14:19 dm-18
brw-rw----. 1 grid oinstall 253, 19 Apr 11 14:19 dm-19
brw-rw----. 1 grid oinstall 253,  2 Apr 11 14:25 dm-2



来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29108064/viewspace-2080972/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29108064/viewspace-2080972/

你可能感兴趣的:(数据库)