Configuring Oracle 18c RAC Using NFS With ASM
阿新 • • 發佈:2018-09-05
add lock silent total -a too 文件 添加 asm 對於沒有共享存儲的環境下,可以使用基於NFS的ASM來配置RAC。這裏簡單描述如何在Oracle 18c RAC環境下配置基於NFS的ASM服務。
1、環境介紹
所用到的主機信息如圖中所示:
2、NFS Server配置
[root@onas ~]# vi /etc/exports
/u02 *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
[root@onas ~]# systemctl restart nfs
[root@onas ~]# showmount -e
Export list for onas:
/u02 *
3、RAC節點掛載NFS共享
RAC節點分別編輯/etc/fstab文件,加入以下內容:
[root@odb01 ~]# vi /etc/fstab onas:/u02 /u02 nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0 [root@odb01 ~]# mount -a [root@odb02 ~]# vi /etc/fstab onas:/u02 /u02 nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0 [root@odb02 ~]# mount -a
4、安裝Grid組件
4.1 初始安裝
具體的安裝過程不做過多描述,只截取幾張ASM部分的截圖。
這裏使用第二個選項“Configure ASM on NFS”,使用了此選項後,系統會自動創建共享磁盤。
指定OCR的位置,下一步。待Grid組件安裝並配置完成後,默認會創建一塊30G大小的磁盤ocrvfdgdisk0,用於OCRVFDG磁盤組,如下:
[root@odb01 ~]# la /u02/asmrac/ total 33G drwxr-xr-x 2 grid oinstall 40 Sep 4 17:05 . drwxr-xr-x 8 root root 4.0K Sep 4 15:09 .. -rw-rw---- 1 grid asmadmin 28G Sep 5 09:52 ocrvfdgdisk0
通過asmca圖形界面查看,如下圖所示:
4.2 創建磁盤組
在共享目錄下,創建了10塊虛擬磁盤:asmdisk1~asmdisk10,分別演示使用asmca和命令行創建磁盤組。通過asmca圖形界面創建data磁盤組,通過asmca命令創建fra磁盤組。
[grid@odb01 ~]$ asmca -silent -sysAsmPassword abcABC12 -asmsnmpPassword abcABC12 -createDiskGroup -diskString ‘/u02/asmrac‘ -diskGroupName fra -diskList /u02/asmrac/asmdisk6 -redundancy external -au_size 4
[INFO] [DBT-30001] Disk groups created successfully. Check /u01/app/grid/cfgtoollogs/asmca/asmca-180905AM105833.log for details.
//添加磁盤
[grid@odb01 ~]$ asmca -silent -sysAsmPassword abcABC12 -asmsnmpPassword abcABC12 -addDisk -diskString ‘/u02/asmrac‘ -diskGroupName fra -diskList /u02/asmrac/asmdisk7,/u02/asmrac/asmdisk8,/u02/asmrac/asmdisk9
[grid@odb01 ~]$ asmcmd lsdsk -t -G fra
Create_Date Mount_Date Repair_Timer Path
05-SEP-18 05-SEP-18 0 /u02/asmrac/asmdisk6
05-SEP-18 05-SEP-18 0 /u02/asmrac/asmdisk7
05-SEP-18 05-SEP-18 0 /u02/asmrac/asmdisk8
05-SEP-18 05-SEP-18 0 /u02/asmrac/asmdisk9
5、使用ASMLib配置
5.1 創建虛擬共享磁盤
[root@onas asmdisks]# for i in {1..10};do dd if=/dev/zero of=/u02/asmrac/asmdisk$i bs=1024k count=10000;done
[root@odb01 ~]# ll /u02/asmrac/
total 102400000
-rw-r--r-- 1 root root 10485760000 Sep 4 11:41 asmdisk1
-rw-r--r-- 1 root root 10485760000 Sep 4 11:41 asmdisk2
-rw-r--r-- 1 root root 10485760000 Sep 4 11:41 asmdisk3
-rw-r--r-- 1 root root 10485760000 Sep 4 11:41 asmdisk4
-rw-r--r-- 1 root root 10485760000 Sep 4 11:41 asmdisk5
-rw-r--r-- 1 root root 10485760000 Sep 4 11:41 asmdisk6
-rw-r--r-- 1 root root 10485760000 Sep 4 11:41 asmdisk7
-rw-r--r-- 1 root root 10485760000 Sep 4 11:41 asmdisk8
-rw-r--r-- 1 root root 10485760000 Sep 4 11:41 asmdisk9
-rw-r--r-- 1 root root 10485760000 Sep 4 11:41 asmdisk10
5.2 配置ASMLib服務
在RAC各個節點分別配置asmlib服務,如下:
root@odb01 ~]# oracleasm configure -i
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets (‘[]‘). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: grid
Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
[root@odb01 ~]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Configuring "oracleasm" to use device physical block size
Mounting ASMlib driver filesystem: /dev/oracleasm
5.3 創建塊設備
如果使用asmlib,必須使用losetup命令創建塊設備,如下:
[root@odb01 ~]# for i in {1..10};do losetup /dev/loop$i /u02/asmdisks/asmdisk$i;done
[root@odb01 ~]# ll /dev/loop*
brw-rw---- 1 root disk 7, 1 Sep 4 14:35 /dev/loop1
brw-rw---- 1 root disk 7, 10 Sep 4 14:35 /dev/loop10
brw-rw---- 1 root disk 7, 2 Sep 4 14:35 /dev/loop2
brw-rw---- 1 root disk 7, 3 Sep 4 14:35 /dev/loop3
brw-rw---- 1 root disk 7, 4 Sep 4 14:35 /dev/loop4
brw-rw---- 1 root disk 7, 5 Sep 4 14:35 /dev/loop5
brw-rw---- 1 root disk 7, 6 Sep 4 14:35 /dev/loop6
brw-rw---- 1 root disk 7, 7 Sep 4 14:35 /dev/loop7
brw-rw---- 1 root disk 7, 8 Sep 4 14:35 /dev/loop8
brw-rw---- 1 root disk 7, 9 Sep 4 14:35 /dev/loop9
crw-rw---- 1 root disk 10, 237 Sep 4 14:35 /dev/loop-control
[root@odb02 ~]# for i in {1..10};do losetup /dev/loop$i /u02/asmdisks/asmdisk$i;done
[root@odb02 ~]# ll /dev/loop*
5.4 創建ASM磁盤
[root@odb01 ~]# for i in {1..10};do oracleasm createdisk vol$i /dev/loop$i;done
[root@odb02 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "VOL1"
Instantiating disk "VOL2"
Instantiating disk "VOL3"
Instantiating disk "VOL4"
Instantiating disk "VOL5"
Instantiating disk "VOL6"
Instantiating disk "VOL7"
Instantiating disk "VOL8"
Instantiating disk "VOL9"
Instantiating disk "VOL10"
5.5 使用ASM磁盤
在安裝Grid組件時,在配置“Storage Option”中選擇第一個選項“Configure ASM using block devices”,如下圖:
Configuring Oracle 18c RAC Using NFS With ASM