发布网友 发布时间:2022-04-24 02:11
共1个回答
热心网友 时间:2022-04-11 21:35
利用UDEV服务解决RACASM存储设备名在我们介绍了使用ASMLIB作为一种专门为OracleAutomaticStorageManagement特性设计的内核支持库(kernelsupportlibrary)的优缺点,同时建议使用成熟的UDEV方案来替代ASMLIB。这里我们就给出配置UDEV的具体步骤,还是比较简单的:1.确认在所有RAC节点上已经安装了必要的UDEV包[root@rh2~]#rpm-qa|grepudevudev-095-14.21.el52.通过scsi_id获取设备的块设备的唯一标识名,假设系统上已有LUNsdc-sdpforiincdefghijklmnop;doecho"sd$i""`scsi_id-g-u-s/block/sd$i`";donesdc1IET_00010001sdd1IET_00010002sde1IET_00010003sdf1IET_00010004sdg1IET_00010005sdh1IET_00010006sdi1IET_00010007sdj1IET_00010008sdk1IET_00010009sdl1IET_0001000asdm1IET_0001000bsdn1IET_0001000csdo1IET_0001000dsdp1IET_0001000e以上列出于块设备名对应的唯一标识名3.创建必要的UDEV配置文件,首先切换到配置文件目录[root@rh2~]#cd/etc/udev/rules.d定义必要的规则配置文件[root@rh2rules.d]#touch99-oracle-asmdevices.rules[root@rh2rules.d]#cat99-oracle-asmdevices.rulesKERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id-g-u-s%p",RESULT=="1IET_00010001",NAME="ocr1",OWNER="grid",GROUP="asmadmin",MODE="0660"KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id-g-u-s%p",RESULT=="1IET_00010002",NAME="ocr2",OWNER="grid",GROUP="asmadmin",MODE="0660"KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id-g-u-s%p",RESULT=="1IET_00010003",NAME="asm-disk1",OWNER="grid",GROUP="asmadmin",MODE="0660"KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id-g-u-s%p",RESULT=="1IET_00010004",NAME="asm-disk2",OWNER="grid",GROUP="asmadmin",MODE="0660"KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id-g-u-s%p",RESULT=="1IET_00010005",NAME="asm-disk3",OWNER="grid",GROUP="asmadmin",MODE="0660"KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id-g-u-s%p",RESULT=="1IET_00010006",NAME="asm-disk4",OWNER="grid",GROUP="asmadmin",MODE="0660"KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id-g-u-s%p",RESULT=="1IET_00010007",NAME="asm-disk5",OWNER="grid",GROUP="asmadmin",MODE="0660"KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id-g-u-s%p",RESULT=="1IET_00010008",NAME="asm-disk6",OWNER="grid",GROUP="asmadmin",MODE="0660"KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id-g-u-s%p",RESULT=="1IET_00010009",NAME="asm-disk7",OWNER="grid",GROUP="asmadmin",MODE="0660"KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id-g-u-s%p",RESULT=="1IET_0001000a",NAME="asm-disk8",OWNER="grid",GROUP="asmadmin",MODE="0660"KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id-g-u-s%p",RESULT=="1IET_0001000b",NAME="asm-disk9",OWNER="grid",GROUP="asmadmin",MODE="0660"KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id-g-u-s%p",RESULT=="1IET_0001000c",NAME="asm-disk10",OWNER="grid",GROUP="asmadmin",MODE="0660"KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id-g-u-s%p",RESULT=="1IET_0001000d",NAME="asm-disk11",OWNER="grid",GROUP="asmadmin",MODE="0660"KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id-g-u-s%p",RESULT=="1IET_0001000e",NAME="asm-disk12",OWNER="grid",GROUP="asmadmin",MODE="0660"Result为/sbin/scsi_id-g-u-s%p的输出--MatchthereturnedstringofthelastPROGRAMcall.ThiskeymaybeusedinanyfollowingruleafteraPROGRAMcall.按顺序填入刚才获取的唯一标识名即可OWNER为安装GridInfrastructure的用户,在11gr2中一般为grid,GROUP为asmadminMODE采用0660即可NAME为UDEV映射后的设备名,建议为OCR和VOTEDISK创建独立的DISKGROUP,为了容易区分将该DISKGROUP专用的设备命名为ocr1..ocrn的形式其余磁盘可以根据其实际用途或磁盘组名来命名4.将该规则文件拷贝到其他节点上[root@rh2rules.d]#scp99-oracle-asmdevices.rulesOther_node:/etc/udev/rules.d5.在所有节点上启动udev服务,或者重启服务器即可[root@rh2rules.d]#/sbin/udevcontrolreload_rules[root@rh2rules.d]#/sbin/start_udevStartingudev:[OK]6.检查设备是否到位[root@rh2rules.d]#cd/dev[root@rh2dev]#ls-locr*brw-rw----1gridasmadmin8,32Jul1017:31ocr1brw-rw----1gridasmadmin8,48Jul1017:31ocr2[root@rh2dev]#ls-lasm-disk*brw-rw----1gridasmadmin8,64Jul1017:31asm-disk1brw-rw----1gridasmadmin8,208Jul1017:31asm-disk10brw-rw----1gridasmadmin8,224Jul1017:31asm-disk11brw-rw----1gridasmadmin8,240Jul1017:31asm-disk12brw-rw----1gridasmadmin8,80Jul1017:31asm-disk2brw-rw----1gridasmadmin8,96Jul1017:31asm-disk3brw-rw----1gridasmadmin8,112Jul1017:31asm-disk4brw-rw----1gridasmadmin8,128Jul1017:31asm-disk5brw-rw----1gridasmadmin8,144Jul1017:31asm-disk6brw-rw----1gridasmadmin8,160Jul1017:31asm-disk7brw-rw----1gridasmadmin8,176Jul1017:31asm-disk8brw-rw----1gridasmadmin8,192Jul1017:31asm-disk9