首页 > 数据库 > Oracle > ocr votedisk 维护一
最近对OCR的操作,用root用没反映 又不能执行成功,郁闷,只有用sudo才可以成功,不知道哪里出了点问题!
---其实也是个重新创建的过程
重启每个节点(reboot),并查看群集状态
$ crs_stat -t
CRS-0184: Cannot communicate with the CRS daemon.
显示无法启动
2. 在每个节点,执行rootdelete.sh (root执行)
# $ORA_CRS_HOME/install/rootdelete.sh
Shutting down Oracle Cluster Ready Services (CRS):
OCR initialization failed accessing OCR device: PROC-26: Error while accessing the physical storage Operating System error [No such file or directory] [2]
Shutdown has begun. The daemons should exit soon.
Checking to see if Oracle CRS stack is down...
Oracle CRS stack is not running.
Oracle CRS stack is down now.
Removing script for Oracle Cluster Ready services
Updating ocr file for downgrade
Cleaning up SCR settings in '/etc/oracle/scls_scr'
3. 在Primary 节点,执行rootdeinstall.sh (主节点就是执行安装时的节点)
$ORA_CRS_HOME/install/rootdeinstall.sh(清楚OCR信息,此场景是OCFS2文件系统,将会创建空的OCR文件)而OCR文件位置,来自/etc/oracle/ocr.loc
# more ocr.loc
#Device/file /u03/ocrmirror/ocrmirror.dbf getting replaced by device /u03/ocrmirror/ocrmirror2.dbf
ocrconfig_loc=/u03/ocr/ocr.dbf
ocrmirrorconfig_loc=/u03/ocrmirror/ocrmirror2.dbf
local_only=false
# ./rootdeinstall.sh
Removing contents from OCR mirror device
2560+0 records in
2560+0 records out
Removing contents from OCR device
2560+0 records in
2560+0 records out
[root@db07 install]# ls -l /u03/ocr/ocr.dbf /u03/ocrmirror/ocrmirror.dbf
-rw-r--r-- 1 oratest oinstall 10485760 Oct 29 11:59 /u03/ocrmirror/ocrmirror.dbf
-rw-r--r-- 1 oratest oinstall 10485760 Oct 29 11:59 /u03/ocr/ocr.dbf
4. 执行root.sh (root用户,Primary节点[/etc/oracle/ocr.loc 做试验的时候这个文件竟然发生了不一致,只得手动修改了]
$ORA_CRS_HOME/root.sh
WARNING: directory '/home/oratest/product/10.2.0' is not owned by root
WARNING: directory '/home/oratest/product' is not owned by root
WARNING: directory '/home/oratest' is not owned by rootChecking to see if Oracle CRS stack is already configuredSetting the permissions on OCR backup directorySetting up NS directoriesOracle Cluster Registry configuration upgraded successfully
WARNING: directory '/home/oratest/product/10.2.0' is not owned by root
WARNING: directory '/home/oratest/product' is not owned by root
WARNING: directory '/home/oratest' is not owned by rootSuccessfully accumulated necessary OCR keys.Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.node
5. 在其他节点执行root.sh注意:在第二个节点执行时,需要修改第二节点的ocr.loc内容,记录新的OCR文件(如果修改过)
Running vipca(silent) for configuring nodeapps【我的是虚拟机root用户】
集群基本配置成功,但是出现了点小问题 我vipca的时候 选择了两个网卡 实际中一定要注意 还有就是要提前备份好!
---------------------------------------------
6. 配置ONS (racgons)
# $ORA_CRS_HOME/bin/racgons add_config rac1:6200 rac2:6200 [一个节点执行就可以了 另外节点可以验证使用]
# ./onsctl ping
Number of onsconfiguration retrieved, numcfg = 2onscfg[0] {node = db07, port = 6200}Adding remote host db07:6200onscfg[1] {node = db08, port = 6200}Adding remote host db08:6200ons is running ...
7. 配置Clusterware的网络接口$ $ORA_CRS_HOME/bin/oifcfg iflist
eth0 10.0.0.0eth1 10.32.10.0
$ ./bin/oifcfg setif -global eth0/192.168.59.0:public
$ ./bin/oifcfg setif -global eth1/10.10.10.0:cluster_interconnect
$ ./bin/oifcfg getif
eth1 10.32.10.0 global publiceth0
10.0.0.0 global cluster_interconnect
8. 配置监听 (netca)
$ mv $TNS_ADMIN/listener.ora /tmp/listener.ora.original (每个节点)
$ netca (可视化)
9. 添加资源到OCR (srvctl)
ASM
srvctl add asm -n
$srvctl add asm -i +ASM1 -n rac1 -o /home/oratest/product/10.2.0/db_1
$srvctl add asm -i +ASM2 -n rac2 -o /home/oratest/product/10.2.0/db_1
DATABASE
srvctl add database -d
$srvctl add database -d orcl -o /u01/app/oracle/product/10.2.0/db_1
INSTANCE
srvctl add instance -d
$ srvctl add instance -d orcl -i orcl1 -n rac1
$ srvctl add instance -d orcl -i orcl2 -n rac2 (有就添加,没有就算了)
srvctl add service -d
TAF_policy可设置为NONE,BASIC,PRECONNECT
查看资源(crs_stat -t)
缺少的东西
srvctl add asm -n rac1 -i +ASM1 -o /u01/app/oracle/product/10.2.0/db_1
srvctl add asm -n rac2 -i +ASM2 -o /u01/app/oracle/product/10.2.0/db_1
10. 启动资源和检查
$ srvctl start asm -n rac1
$ srvctl start asm -n rac2
-----------------------------------------------------
启动不起来 要设置这个参数就可以了
+ASM1.cluster_interconnections='10.10.10.10'
+ASM1.cluster_interconnections='10.10.10.11'
直接是启动不起来的 需要添加东东
$ srvctl start database -d TEST
$ srvctl start service -d TEST
$ cluvfy stage -post crsinst -n rac1,rac2
Waitting.......
zhichier is not in the sudoers file. This incident will be reported
这是我在红旗linux6.0下用sudo时遇到的问题,解决方法如下:
1>、进入超级用户模式。也就是输入"su -",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式。(当然,你也可以直接用root用户登录,因为红旗安装过后默认的登录用户就是root)
2>、添加文件的写权限。也就是输入命令"chmod u+w /etc/sudoers"。
3>、编辑/etc/sudoers文件。也就是输入命令"vim /etc/sudoers",输入"i"进入编辑模式,找到这一 行:"root ALL=(ALL) ALL"在起下面添加"xxx ALL=(ALL) ALL"(这里的xxx是你的用户名),然后保存(就是先摁一 下Esc键,然后输入":wq")退出。
4>、撤销文件的写权限。也就是输入命令"chmod u-w /etc/sudoers"。
sudo ocrconfig -replace ocrmirror /ocfs/clusterware/ocrbak1 奶奶的 老子用这个才执行成功
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9879835/viewspace-1055346/ ,如需转载,请注明出处,否则将追究法律责任。