儲存磁碟名稱不同啟動叢集

oracle_mao發表於2013-10-25
當磁碟名稱不一樣的時候,比如一個節點叫maoa,而另一個節點上叫做mdo_a,那如果我們將asm_diskstring設定為/dev/m*的話,那叢集也可以照樣啟動的。
實驗如下:
環境:
節點1:
[grid@RAC1 ~]$ cat /etc/udev/rules.d/99-mao.rules
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=%N", RESULT=="1IET_00010001", NAME="maoa%n",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=%N", RESULT=="1IET_00010002", NAME="maob%n",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=%N", RESULT=="1IET_00010003", NAME="maoc%n",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=%N", RESULT=="1IET_00010004", NAME="maod%n",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=%N", RESULT=="1IET_00010005", NAME="maoe%n",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=%N", RESULT=="1IET_00010006", NAME="maof%n",OWNER="grid",GROUP="asmadmin",MODE="0660"
[grid@RAC1 ~]$ ll /dev/mao*
brw-rw---- 1 grid asmadmin 8,  0 Oct 25 11:03 /dev/maoa
brw-rw---- 1 grid asmadmin 8, 16 Oct 25 11:03 /dev/maob
brw-rw---- 1 grid asmadmin 8, 32 Oct 25 11:03 /dev/maoc
brw-rw---- 1 grid asmadmin 8, 48 Oct 25 11:03 /dev/maod
brw-rw---- 1 grid asmadmin 8, 64 Oct 25 11:03 /dev/maoe
brw-rw---- 1 grid asmadmin 8, 80 Oct 25 11:03 /dev/maof
節點2:
[grid@rac2 ~]$ cat /etc/udev/rules.d/99-mao.rules
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=%N", RESULT=="1IET_00010001", NAME="mdo*a%n",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=%N", RESULT=="1IET_00010002", NAME="mdo*b%n",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=%N", RESULT=="1IET_00010003", NAME="mdo*c%n",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=%N", RESULT=="1IET_00010004", NAME="mdo*d%n",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=%N", RESULT=="1IET_00010005", NAME="mdo*e%n",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=%N", RESULT=="1IET_00010006", NAME="mdo*f%n",OWNER="grid",GROUP="asmadmin",MODE="0660"
[grid@rac2 ~]$ ll /dev/mdo_*
brw-rw---- 1 grid asmadmin 8,  0 Oct 25 11:03 /dev/mdo_a
brw-rw---- 1 grid asmadmin 8, 16 Oct 25 11:03 /dev/mdo_b
brw-rw---- 1 grid asmadmin 8, 32 Oct 25 11:03 /dev/mdo_c
brw-rw---- 1 grid asmadmin 8, 48 Oct 25 11:03 /dev/mdo_d
brw-rw---- 1 grid asmadmin 8, 64 Oct 25 11:03 /dev/mdo_e
brw-rw---- 1 grid asmadmin 8, 80 Oct 25 11:02 /dev/mdo_f
更改asm_diskstring:
SQL> alter system set asm_diskstring='/dev/m*/' scope=spfile;
System altered.
將節點1和節點2的叢集或者機器重啟。發現2個節點的叢集都可以正常被啟動。
檢視:
節點一:
SQL> set linesize 200
SQL> col path for a40
SQL> select name,path,state from v$asm_disk;
NAME                           PATH                                     STATE
------------------------------ ---------------------------------------- --------
DATA_DG_0002                   /dev/maof                                NORMAL
OCR_DG_0002                    /dev/maoc                                NORMAL
DATA_DG_0000                   /dev/maod                                NORMAL
DATA_DG_0001                   /dev/maoe                                NORMAL
OCR_DG_0000                    /dev/maoa                                NORMAL
OCR_DG_0001                    /dev/maob                                NORMAL
6 rows selected.
節點2:
SQL> set linesize 200
SQL> col path for a40
SQL> /
NAME                           PATH                                     STATE
------------------------------ ---------------------------------------- --------
DATA_DG_0000                   /dev/mdo_d                               NORMAL
OCR_DG_0001                    /dev/mdo_b                               NORMAL
DATA_DG_0002                   /dev/mdo_f                               NORMAL
OCR_DG_0002                    /dev/mdo_c                               NORMAL
DATA_DG_0001                   /dev/mdo_e                               NORMAL
OCR_DG_0000                    /dev/mdo_a                               NORMAL
6 rows selected.
SQL> show parameter asm
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups                       string      DATA_DG
asm_diskstring                       string      /dev/m*
asm_power_limit                      integer     1
asm_preferred_read_failure_groups    string
SQL>

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24500180/viewspace-774997/,如需轉載,請註明出處,否則將追究法律責任。

相關文章