您好,登錄后才能下訂單哦!
如何進行Centos7 multipath 盤權限綁定.,針對這個問題,這篇文章詳細介紹了相對應的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。
Centos7 multipath 盤權限綁定.
[root@centos7 ~]$ more /etc/udev/rules.d/99-oracle.rules
KERNEL=="dm-0",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-1",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-2",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-3",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-4",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-5",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-6",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-7",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-8",OWNER="oragrid",GROUP="dba",MODE="0660"
KERNEL=="dm-9",OWNER="oragrid",GROUP="dba",MODE="0660"
關機前的對應關系
[root@centos7 ~]$ ls -l /dev/mapper/
total 0
crw-------. 1 root root 10, 236 Jan 26 12:18 control
lrwxrwxrwx. 1 root root 7 Jan 29 08:06 data01 -> ../dm-3
lrwxrwxrwx. 1 root root 7 Jan 29 08:06 data02 -> ../dm-0
lrwxrwxrwx. 1 root root 7 Jan 26 11:35 data03 -> ../dm-1
lrwxrwxrwx. 1 root root 7 Jan 29 08:06 data04 -> ../dm-4
lrwxrwxrwx. 1 root root 7 Jan 29 08:06 fra01 -> ../dm-5
lrwxrwxrwx. 1 root root 7 Jan 26 11:35 fra02 -> ../dm-6
lrwxrwxrwx. 1 root root 7 Jan 26 11:35 ocr01 -> ../dm-8
lrwxrwxrwx. 1 root root 7 Jan 26 11:35 ocr02 -> ../dm-7
lrwxrwxrwx. 1 root root 7 Jan 26 11:35 ocr03 -> ../dm-9
lrwxrwxrwx. 1 root root 8 Jan 26 12:18 ocr04 -> ../dm-10
lrwxrwxrwx. 1 root root 7 Jan 26 11:35 virtual -> ../dm-2
lrwxrwxrwx. 1 root root 8 Jan 26 12:18 virtual1 -> ../dm-11
重啟后.對應關系發生了變化。如下:
data01重啟是都要dm-3,重啟后是dm-2
[root@centos7 ~]$ ls -l /dev/mapper/
total 0
crw-------. 1 root root 10, 236 Jan 29 2018 control
lrwxrwxrwx. 1 root root 7 Jan 29 2018 data01 -> ../dm-2
lrwxrwxrwx. 1 root root 7 Jan 29 2018 data02 -> ../dm-4
lrwxrwxrwx. 1 root root 7 Jan 29 2018 data03 -> ../dm-5
lrwxrwxrwx. 1 root root 7 Jan 29 2018 data04 -> ../dm-7
lrwxrwxrwx. 1 root root 7 Jan 29 2018 fra01 -> ../dm-3
lrwxrwxrwx. 1 root root 7 Jan 29 2018 fra02 -> ../dm-0
lrwxrwxrwx. 1 root root 7 Jan 29 2018 ocr01 -> ../dm-1
lrwxrwxrwx. 1 root root 7 Jan 29 2018 ocr02 -> ../dm-8
lrwxrwxrwx. 1 root root 8 Jan 29 2018 ocr03 -> ../dm-10
lrwxrwxrwx. 1 root root 7 Jan 29 2018 ocr04 -> ../dm-9
lrwxrwxrwx. 1 root root 7 Jan 29 2018 virtual -> ../dm-6
lrwxrwxrwx. 1 root root 8 Jan 29 2018 virtual1 -> ../dm-11
所以 KERNEL=="dm-0",OWNER="oragrid",GROUP="dba",MODE="0660"
這種綁定權限的方式有問題。
如果恰好沒有綁定到...權限則不能正常賦予了。
采用如下方式,綁定權限。
[root@centos7 /etc/udev/rules.d]$ more 99-oracle.rules
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/ocr01"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/ocr02"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/ocr03"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/ocr04"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/data01"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/data02"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/data03"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/data04"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/fra01"
PROGRAM="/usr/bin/chown oragrid:dba /dev/mapper/fra02"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/ocr01"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/ocr02"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/ocr03"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/ocr04"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/data01"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/data02"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/data03"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/data04"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/fra01"
PROGRAM="/usr/bin/chmod 0660 /dev/mapper/fra02"
重啟后查看權限,給ASM用的盤的權限正常。
[root@centos7 /etc/udev/rules.d]$ ls -l /dev/mapper/
total 0
crw-------. 1 root root 10, 236 Jan 29 2018 control
lrwxrwxrwx. 1 root root 7 Jan 29 09:47 data01 -> ../dm-3
lrwxrwxrwx. 1 root root 7 Jan 29 09:47 data02 -> ../dm-5
lrwxrwxrwx. 1 root root 7 Jan 29 09:41 data03 -> ../dm-4
lrwxrwxrwx. 1 root root 7 Jan 29 09:47 data04 -> ../dm-2
lrwxrwxrwx. 1 root root 7 Jan 29 09:47 fra01 -> ../dm-6
lrwxrwxrwx. 1 root root 7 Jan 29 09:41 fra02 -> ../dm-0
lrwxrwxrwx. 1 root root 7 Jan 29 09:41 ocr01 -> ../dm-7
lrwxrwxrwx. 1 root root 7 Jan 29 09:41 ocr02 -> ../dm-8
lrwxrwxrwx. 1 root root 8 Jan 29 09:41 ocr03 -> ../dm-10
lrwxrwxrwx. 1 root root 7 Jan 29 09:41 ocr04 -> ../dm-9
lrwxrwxrwx. 1 root root 7 Jan 29 2018 virtual -> ../dm-1
lrwxrwxrwx. 1 root root 8 Jan 29 2018 virtual1 -> ../dm-11
[root@centos7 /etc/udev/rules.d]$ ls -l /dev/dm*
brw-rw----. 1 oragrid dba 253, 0 Jan 29 09:41 /dev/dm-0
brw-rw----. 1 root disk 253, 1 Jan 29 2018 /dev/dm-1
brw-rw----. 1 oragrid dba 253, 10 Jan 29 09:41 /dev/dm-10
brw-rw----. 1 root disk 253, 11 Jan 29 2018 /dev/dm-11
brw-rw----. 1 oragrid dba 253, 2 Jan 29 09:47 /dev/dm-2
brw-rw----. 1 oragrid dba 253, 3 Jan 29 09:51 /dev/dm-3
brw-rw----. 1 oragrid dba 253, 4 Jan 29 09:41 /dev/dm-4
brw-rw----. 1 oragrid dba 253, 5 Jan 29 09:51 /dev/dm-5
brw-rw----. 1 oragrid dba 253, 6 Jan 29 09:51 /dev/dm-6
brw-rw----. 1 oragrid dba 253, 7 Jan 29 09:51 /dev/dm-7
brw-rw----. 1 oragrid dba 253, 8 Jan 29 09:51 /dev/dm-8
brw-rw----. 1 oragrid dba 253, 9 Jan 29 09:41 /dev/dm-9
chown,chmod加上命令的全路徑。
關于如何進行Centos7 multipath 盤權限綁定.問題的解答就分享到這里了,希望以上內容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關注億速云行業資訊頻道了解更多相關知識。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。