安装clusterware过程中,如果选择External Redundancy冗余方式,则只能输入一个OCR磁盘位置。但是Oracle允许配置两个OCR磁盘互为镜像,以防止OCR磁盘的单点故障。OCR磁盘和Votedisk磁盘不一样,OCR磁盘最多只能有两个,一个Primary OCR和一个Mirror OCR。
冷备份一个ocr作为挂盘后的恢复来源
[[email protected] ~]# crsctl stop crs
[[email protected] ~]# ocrconfig -export /opt/oracle/otk/home/oracle/product/10.2.0/crs/cdata/crs/ocr.exp
创建一个新的vdi虚拟盘挂接双机
+
more /etc/udev/rules.d/60-raw.rules
增加如下raw信息
ACTION=="add", KERNEL=="/dev/sdf1",RUN+="/bin/raw /dev/raw/raw5 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="81",RUN+="/bin/raw /dev/raw/raw5 %M %m"
MINOR值参见votedisk冗余中截图
ACTION=="add", KERNEL=="raw5", OWNER="root", GROUP="oinstall", MODE="0660"
start_udev
[[email protected] ~]# ll /dev/raw/*
crw-rw---- 1 oracle oinstall 162, 1 04-30 09:38 /dev/raw/raw1
crw-rw---- 1 root oinstall 162, 2 04-30 09:38 /dev/raw/raw2
crw-rw---- 1 oracle oinstall 162, 3 04-30 09:18 /dev/raw/raw3
crw-rw---- 1 oracle oinstall 162, 4 04-30 09:18 /dev/raw/raw4
crw-rw---- 1 root oinstall 162, 5 04-30 09:38 /dev/raw/raw5
crw-rw---- 1 oracle oinstall 162, 6 04-30 09:38 /dev/raw/raw6
crw-rw---- 1 oracle oinstall 162, 7 04-30 09:38 /dev/raw/raw7
然后开始用命令挂
与votedisk增加不同ocr必须crs开启状态
ocrconfig -replace ocrmirror /dev/raw/raw5
结果报错PROT-22: Storage too small
查了下网络上资料,说是bug,但是可以手工修改配置文件实现
[[email protected] ~]# more /etc/oracle/ocr.loc
ocrconfig_loc=/dev/raw/raw2
ocrmirrorconfig_loc=/dev/raw/raw5
local_only=FALSE
[[email protected] ~]#
修改如上代码即可,但是这样估计新挂的raw5内容没有同步,可能得进行一次内容恢复写上,估计ocrconfig -replace ocrmirror /dev/raw/raw5 命令合适的话,是不需要这一步的
[[email protected] ocrbak]# dd if=/dev/zero of=/dev/raw/raw2 bs=1024k count=100
100+0 records in
100+0 records out
[[email protected] ocrbak]# dd if=/dev/zero of=/dev/raw/raw5 bs=1024k count=100
100+0 records in
100+0 records out
[[email protected] ~]# ocrconfig -import /opt/oracle/otk/home/oracle/product/10.2.0/crs/cdata/crs/ocr.exp
[[email protected] ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 112336
Used space (kbytes) : 4364
Available space (kbytes) : 107972
ID : 1586383335
Device/File Name : /dev/raw/raw2
Device/File integrity check succeeded
Device/File Name : /dev/raw/raw5
Device/File integrity check succeeded
Cluster registry integrity check succeeded
You have new mail in /var/spool/mail/root
[[email protected] ~]#
在第二个节点操作的,第一个节点会挂掉,重新重启俩个vm即可,起来就都合适了
手工重启crs不管用,因为手工的步骤太多了,电脑反应不过来