oracle rac votedisk可以存放数据文件吗
发布网友
发布时间:2022-04-13 13:48
我来回答
共1个回答
热心网友
时间:2022-04-13 15:17
--在11g的RAC中使用两存储镜像作votedisk的方法
在11g中,使用如下语法创建普通冗余磁盘组用于存放ocr和votedisk
CREATE DISKGROUP ocr NORMAL REDUNDANCY
FAILGROUP a1 DISK
'/dev/asm_a1_ocr2' name a1ocr2
FAILGROUP a2 DISK
'/dev/asm_a2_ocr2' name a2ocr2
ATTRIBUTE 'compatible.asm' = '11.2';
这样可以做到一个存储物理故障时,无缝迁移到第二个存储上
但是在使用这种方法作votedisk盘的迁移工作时,报一下错误:
[grid@pay1 ~]$ crsctl replace votedisk +OCR
Failed to create voting files on disk group OCR.
Change to configuration failed, but was successfully rolled back.
CRS-4000: Command Replace failed, or completed with errors.
查找其原因,是因为 NORMAL REDUNDANCY的磁盘组需要有个3个failgroup才能用于存放votedisk.
因此需要想办法弄出第三个failgroup,但是第三个failgroup放置在任何一个存储上都不合适,那个存储上放置了2个failgroup,那么这个存储故障时,整个cluster都将由于votedisk没有超过半数而不能正常运行.
那如何构造第三个failgroup在此时就变得尤为重要了.以下提供集中办法
1.使用nfs技术新挂载一个磁盘,然后将此盘加载成quorum failgroup组,这样就成3个failgroup.metalink上有关于此的说明(Oracle Support Document 1421588.1 (How to Manually Add NFS voting disk to an Extended Cluster using ASM in 11.2) can be found at: https://support.oracle.com/epmos/faces/DocumentDisplay?id=1421588.1)
2.两个存储上都划一个小盘500M,在os系统中做lv镜像,然后使用lv镜像作quorum failgroup组,这样就成3个failgroup.原理和2相同,就是要一个盘做failgroup.
本文仅将第一种方案提供具体的步骤和说明
1.选择一个nfs服务器,并配置合适的权限.为简单示例,为对访问作任何*
vi /etc/exports
/mypool/oraclevotedisk * (rw)
重启动nfs服务
service portmap restart
service nfs restart
2.在rac环境中的每一台都创建一个空目录
mkdir /oracle/votedisk
3.挂载分区
mount -o rw,bg,hard,intr,rsize=32768,wsize=32768,tcp,noac,vers=3,timeo=600 192.168.100.2:/mypool/oraclevotedisk /oracle/votedisk
3.在任意一台机器上使用此分区作一个投票盘,并授予合适的权限
dd if=/dev/zero of=/oracle/votedisk/vote_pay bs=1M count=500
--dd if=/dev/zero of=/oracle/votedisk/vote_pay bs=1M count=1000
授予权限
chown grid:asmadmin /oracle/votedisk/vote_pay
4.在一个asm实例中,修改查找串路径,并增加投票盘
alter system set asm_diskstring='/dev/asm*','/oracle/votedisk/vote_pay';
--看文件是否已经被找到
col path format A40
select group_number,name,path,mount_status,header_status,state,REDUNDANCY,FAILGROUP,voting_file from v$asm_disk;
--增加投票盘
alter diskgroup ocr add quorum failgroup nfs disk '/oracle/votedisk/vote_pay';
5.以grid用户切换votedisk
[grid@pay1 ~]$ crsctl replace votedisk +OCR
Successful addition of voting disk 58c1ac72dff94f25bffc8e649a36c883.
Successful addition of voting disk 076f0b3e9b0a4f5cbf26841c540211a7.
Successful addition of voting disk 84cf735c784e4f74bf5d55fc99e98422.
Successful deletion of voting disk 73fb4a797e624fa9bf382f841340dfa8.
Successfully replaced voting disk group with +OCR.
可以看到,现在就可以成功替换投票盘了
6.检查votedisk情况
[grid@pay1 ~]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 58c1ac72dff94f25bffc8e649a36c883 (/dev/asm_a1_ocr3) [OCR]
2. ONLINE 076f0b3e9b0a4f5cbf26841c540211a7 (/dev/asm_a2_ocr3) [OCR]
3. ONLINE 84cf735c784e4f74bf5d55fc99e98422 (/oracle/votedisk/vote_pay) [OCR]
Located 3 voting disk(s).