配置RAC,并启动
OCM9.2.0.4使用hangcheck-timer来代替watchdog,因此手工修改配置文件和启动文件.
先检查模块是否已经安装,看这个文件是否存在:
/lib/modules/2.4.21-4.EL/kernel/drivers/char/hangcheck-timer.o
如果不存在,则需要安装.
因为我的系统中,有这个文件,我就没有去找这个文件到底在哪个包中,所以,我也不知道该装哪个包!
配置内核模块,使用hangcheck-timer代替watchdog:
# lsmod | grep watchdog
应该没有输出.否则使用
# rmmod 命令去掉这个模块.
然后加载hangcheck-timer模块
# insmod hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
Using /lib/modules/2.4.21-4.EL/kernel/drivers/char/hangcheck-timer.o
确认模块已经加载:
# lsmod | grep hang
hangcheck-timer 2648 0 (unused)
使系统一启动就加载这个模块,需要在/etc/rc.local文件最后加入一行:
/sbin/insmod hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
修改配置文件和启动文件:
$ORACLE_HOME/oracm/bin/ocmstart.sh
启动命令行.将所有有关watchdog的行全部注释掉.将这几行注释为以下的样子:
# watchdogd's default log file
# WATCHDOGD_LOG_FILE=$ORACLE_HOME/oracm/log/wdd.log
# watchdogd's default backup file
# WATCHDOGD_BAK_FILE=$ORACLE_HOME/oracm/log/wdd.log.bak
# Get arguments
# watchdogd_args=`grep '^watchdogd' $OCMARGS_FILE |\
# sed -e 's+^watchdogd *++'`
# Check watchdogd's existance
# if watchdogd status | grep 'Watchdog daemon active' >/dev/null
# then
# echo 'ocmstart.sh: Error: watchdogd is already running'
# exit 1
# fi
# Backup the old watchdogd log
# if test -r $WATCHDOGD_LOG_FILE
# then
# mv $WATCHDOGD_LOG_FILE $WATCHDOGD_BAK_FILE
# fi
# Startup watchdogd
# echo watchdogd $watchdogd_args
# watchdogd $watchdogd_args
$ORACLE_HOME/oracm/admin/ocmargs.ora
参数文件,去掉或注释掉下面这行:
watchdogd
$ORACLE_HOME/oracm/admin/cmcfg.ora
配置文件.将cmcfg.ora.tmp拷贝为cmcfg.ora文件,并修改成以下样子:
HeartBeat=15000
ClusterName=Oracle Cluster Manager, version 9i
PollInterval=1000
MissCount=210
PrivateNodeNames=hostname
PublicNodeNames=hostname
ServicePort=9998
HostName=ao-040
CmDiskFile=/u02/rac/RacFile
KernelModuleName=hangcheck-timer
其中,PrivateNodeNames和PublicNodeNames要跟你安装OCM时填入的hostname相同.
CmDiskFile要跟你先前生成的Quorum Disk File一样.
最后一行确认使用hangcheck-timer模块.
启动OCM:
官方文档中,创建了一个启动脚本,因为是用来玩,就省略了这一步.用命令行来启动:
$ su
# cd $ORACLE_HOME/oracm/bin
# ./ocmstart.sh
oracm &1 >/u01/app/oracle/product/9.2.0.4.0/oracm/log/cm.out &
如果启动太频繁,可能会报错:
ocmstart.sh: Error: Restart is too frequent
ocmstart.sh: Info: Check the system configuration and fix the problem.
ocmstart.sh: Info: After you fixed the problem, remove the timestamp file
ocmstart.sh: Info: "/u01/app/oracle/product/9.2.0.4.0/oracm/log/ocmstart.ts"
这时,用
# killall oracm
# ps -ef | grep oracm
来确认OCM没有启动.再将/u01/app/oracle/product/9.2.0.4.0/oracm/log/ocmstart.ts文件删除了就可以启动了.
# rm -f /u01/app/oracle/product/9.2.0.4.0/oracm/log/ocmstart.ts
# ./ocmstart.sh
oracm &1 >/u01/app/oracle/product/9.2.0.4.0/oracm/log/cm.out &