使用UDEV在Oracle Linux 6上安装Oracle 11g RAC(11.2.0.3) (二)
配置共享磁盘,本次实验环境是基于VMware ESXi 5搭建。
和vbox配置差不多,具体过程略,关闭node1,node2,说明一下需要注意的地方
SCSI控制器选择 LIS Logic并行,类型选择虚拟,虚拟磁盘可以在同一台服务器上共享,磁盘的虚拟设备节点选择1:1,1:2依次类推,这里添加了6块共享磁盘。
node1创建磁盘之后,node2选择已有磁盘,选择路径添加即可
在node1,和node2的vmx配置文件中添加以下语句,否则无法获取磁盘UUID
disk.enableUUID = "TRUE"
scsi1:4.present = "TRUE" scsi1:4.fileName = "/vmfs/volumes/4fd87396-c40232e5-5ae4-001e6719f392/zhongwc1/zhongwc1_4.vmdk" scsi1:4.deviceType = "scsi-hardDisk" scsi1:5.present = "TRUE" scsi1:5.fileName = "/vmfs/volumes/4fd87396-c40232e5-5ae4-001e6719f392/zhongwc1/zhongwc1_5.vmdk" scsi1:5.deviceType = "scsi-hardDisk" scsi1:6.present = "TRUE" scsi1:6.fileName = "/vmfs/volumes/4fd87396-c40232e5-5ae4-001e6719f392/zhongwc1/zhongwc1_6.vmdk" scsi1:6.deviceType = "scsi-hardDisk" scsi0:13.present = "FALSE" scsi1:1.redo = "" scsi1:2.redo = "" scsi1:3.redo = "" scsi1:4.redo = "" scsi1:5.redo = "" scsi1:6.redo = "" scsi1.pciSlotNumber = "35" disk.enableUUID = "TRUE"
启动node1,node2测试共享磁盘
node1
[root@node1 ~]# fdisk -l Disk /dev/sda: 107.4 GB, 107374182400 bytes 255 heads, 63 sectors/track, 13054 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000119e9 Device Boot Start End Blocks Id System /dev/sda1 * 1 26 204800 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 26 809 6291456 82 Linux swap / Solaris Partition 2 does not end on cylinder boundary. /dev/sda3 809 13055 98360320 83 Linux Disk /dev/sdb: 1073 MB, 1073741824 bytes 255 heads, 63 sectors/track, 130 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdc: 1073 MB, 1073741824 bytes 255 heads, 63 sectors/track, 130 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdd: 1073 MB, 1073741824 bytes 255 heads, 63 sectors/track, 130 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sde: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdf: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdg: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 [root@node1 ~]# [root@node1 ~]# ls -l /dev/sd* brw-rw---- 1 root disk 8, 0 Dec 28 17:08 /dev/sda brw-rw---- 1 root disk 8, 1 Dec 28 17:08 /dev/sda1 brw-rw---- 1 root disk 8, 2 Dec 28 17:08 /dev/sda2 brw-rw---- 1 root disk 8, 3 Dec 28 17:08 /dev/sda3 brw-rw---- 1 root disk 8, 16 Dec 28 17:08 /dev/sdb brw-rw---- 1 root disk 8, 32 Dec 28 17:08 /dev/sdc brw-rw---- 1 root disk 8, 48 Dec 28 17:08 /dev/sdd brw-rw---- 1 root disk 8, 64 Dec 28 17:08 /dev/sde brw-rw---- 1 root disk 8, 80 Dec 28 17:08 /dev/sdf brw-rw---- 1 root disk 8, 96 Dec 28 17:08 /dev/sdg
[root@node2 ~]# fdisk -l Disk /dev/sda: 107.4 GB, 107374182400 bytes 255 heads, 63 sectors/track, 13054 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000ac6e9 Device Boot Start End Blocks Id System /dev/sda1 * 1 26 204800 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 26 809 6291456 82 Linux swap / Solaris Partition 2 does not end on cylinder boundary. /dev/sda3 809 13055 98360320 83 Linux Disk /dev/sdb: 1073 MB, 1073741824 bytes 255 heads, 63 sectors/track, 130 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdc: 1073 MB, 1073741824 bytes 255 heads, 63 sectors/track, 130 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdd: 1073 MB, 1073741824 bytes 255 heads, 63 sectors/track, 130 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sde: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdf: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdg: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 [root@node2 ~]# ls -l /dev/sd* brw-rw---- 1 root disk 8, 0 Dec 28 17:08 /dev/sda brw-rw---- 1 root disk 8, 1 Dec 28 17:08 /dev/sda1 brw-rw---- 1 root disk 8, 2 Dec 28 17:08 /dev/sda2 brw-rw---- 1 root disk 8, 3 Dec 28 17:08 /dev/sda3 brw-rw---- 1 root disk 8, 16 Dec 28 17:08 /dev/sdb brw-rw---- 1 root disk 8, 32 Dec 28 17:08 /dev/sdc brw-rw---- 1 root disk 8, 48 Dec 28 17:08 /dev/sdd brw-rw---- 1 root disk 8, 64 Dec 28 17:08 /dev/sde brw-rw---- 1 root disk 8, 80 Dec 28 17:08 /dev/sdf brw-rw---- 1 root disk 8, 96 Dec 28 17:08 /dev/sdg
使用以下脚本获取共享磁盘的UUID,配置ASM共享存储
for i in b c d e f g do echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\"" done
node1
[root@node1 ~]# cat /etc/udev/rules.d/99-oracle-asmdevices.rules KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c294347acba383e23ecbd43867c4", NAME="asm-diskb", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c2913d3b49354c9d030816bd5de9", NAME="asm-diskc", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c296cf9ff63b87e2903925bdec21", NAME="asm-diskd", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c2952ef3147bf0c3efc345133b00", NAME="asm-diske", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c296f16a22e6292edfb3ec3b1934", NAME="asm-diskf", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29ae38dfe96f6342cb2afd7f3fb", NAME="asm-diskg", OWNER="grid", GROUP="asmadmin", MODE="0660"
[root@node1 ~]# scp /etc/udev/rules.d/99-oracle-asmdevices.rules node2:/etc/udev/rules.d/ root@node2's password: 99-oracle-asmdevices.rules 100% 1296 1.3KB/s 00:00 [root@node1 ~]#
[root@node1 ~]# start_udev Starting udev: [ OK ] [root@node1 ~]# ll /dev/asm-disk* brw-rw---- 1 grid asmadmin 8, 16 Dec 28 17:22 /dev/asm-diskb brw-rw---- 1 grid asmadmin 8, 32 Dec 28 17:22 /dev/asm-diskc brw-rw---- 1 grid asmadmin 8, 48 Dec 28 17:22 /dev/asm-diskd brw-rw---- 1 grid asmadmin 8, 64 Dec 28 17:22 /dev/asm-diske brw-rw---- 1 grid asmadmin 8, 80 Dec 28 17:22 /dev/asm-diskf brw-rw---- 1 grid asmadmin 8, 96 Dec 28 17:22 /dev/asm-diskg [root@node1 ~]#
[root@node2 ~]# start_udev Starting udev: [ OK ] [root@node2 ~]# ll /dev/asm-disk* brw-rw---- 1 grid asmadmin 8, 32 Dec 28 17:22 /dev/asm-diskb brw-rw---- 1 grid asmadmin 8, 48 Dec 28 17:22 /dev/asm-diskc brw-rw---- 1 grid asmadmin 8, 16 Dec 28 17:22 /dev/asm-diskd brw-rw---- 1 grid asmadmin 8, 64 Dec 28 17:22 /dev/asm-diske brw-rw---- 1 grid asmadmin 8, 80 Dec 28 17:22 /dev/asm-diskf brw-rw---- 1 grid asmadmin 8, 96 Dec 28 17:22 /dev/asm-diskg