Oprocd & Hangcheck-timer


Process Monitor Daemon (OPROCD)

1.Process Monitor Daemon (OPROCD): This process is locked in memory to monitor the cluster and provide I/O fencing. OPROCD performs its check, stops running, and if the wake up is beyond the expected time, then OPROCD resets the processor and reboots the node. An OPROCD failure results in Oracle Clusterware restarting the node. OPROCD uses the hangcheck timer on Linux platforms.
OPROCD introduced in 10.2.0.4 Linux and other Unix platform.
Note that oprocd only runs when no vendor clusterware is running or on Linux > 10.2.0.4
 
OPROCD takes two parameters
-t  - Timeout value
Length of time between executions (milliseconds)
Normally defaults to 1000
-m - Margin
Acceptable margin before rebooting (milliseconds)
Normally defaults to 500
缺省的情况下,-t为1秒,-m为0.5秒,OPROCD重启的延时为1.5秒
$ ps -efl | grep oprocd
0 S root 6444 3080 0 78 0 - 636 - Apr15 ? 00:00:00 /bin/sh /etc/init.d/init.cssd oprocd
4 S root 7255 6444 0 -40 - - 516 - Apr15 ? 00:00:00 /u01/app/crs11g/bin/oprocd run -t 1000 -m 500 -f
在11gR2以前,可以通过diagwait来延长oprocd发起重启的时间,步骤如下:
1.Log in as root, and run the following command on all nodes, where CRS_home is the home directory of the Oracle Clusterware installation:
  # CRS_home/bin/crsctl stop crs
2.Enter the following command, where CRS_home is the Oracle Clusterware home:
  # CRS_home/bin/oprocd stop
  Repeat this command on all nodes.
3.Ensure that Clusterware stack is down on all nodes by executing
  # ps -ef |egrep "crsd.bin|ocssd.bin|evmd.bin|oprocd"
4.From one node of the cluster, change the value of the diagwait parameter to 13 seconds by issuing the following command as root:
  # CRS_home/bin/crsctl set css diagwait 13 -force
5.Check if diagwait is set successfully by executing. the following command. The command should return 13. If diagwait is not set, the following message will be returned "Configuration parameter diagwait is not defined"
  # crsctl get css diagwait
6.Restart the Oracle Clusterware by running the following command on all nodes:
  # CRS_home/bin/crsctl start crs
7.Run the following command to ensure that Oracle Clusterware is functioning properly:
  # CRS_home/bin/crsctl check crs
Unsetting/Removing diagwait
#crsctl unset css diagwait -force
(Note:  the -force option must be used when unsetting diagwait since CRS will be down when doing so)
Starting with 11.2.0.1, Customers do not need to set diagwait as the architecture has been changed.
Diagwait can be set on windows but it does not change the behaviour as it does on Unix-Linux platforms
调整diagwait为13后的参数值,OPROCD重启的延时为11秒
$ ps -efl | grep oprocd
0 S root 6444 3080 0 78 0 - 636 - Apr15 ? 00:00:00 /bin/sh /etc/init.d/init.cssd oprocd
4 S root 7255 6444 0 -40 - - 516 - Apr15 ? 00:00:00 /u01/app/crs11g/bin/oprocd run -t 1000 -m 10000 -f

Hangcheck-Timer Module
2.Hangcheck-Timer Module Requirements for Oracle 9i, 10g, and 11g RAC on Linux
Starting in release 9.2.0.2 and later, Oracle RAC environments required using a new I/O fencing model, named the hangcheck-timer module. This module was implemented to replace the Watchdog module, which provided similar fencing functionality. Hangcheck-timer was subsequently delivered as part of the standard kernel distribution for Linux kernel releases 2.4 and above.
Hangcheck-timer should be loaded at boot time, and monitors the Linux kernel for long operating system hangs that could affect the reliability of a RAC node.  It runs in kernel mode and uses the Time Stamp Counter (TSC) to catch scheduling delays or node hangs.  This is done by setting a timer, then checking when the timer fires as to whether it was delayed by more than the allowed margin of error.  If the duration exceeds the allowed time of (hangcheck_tick + hangcheck_margin seconds), the machine is restarted.  Hangcheck-timer will not cause reboots to occur due to CPU starvation.
 Hangcheck-timer requires three configuration parameters:
    hangcheck_tick - defines how often, in seconds, the hangcheck-timer checks the node for hangs. The default value is 60 seconds.
    hangcheck_margin - defines how much margin is allowed, in seconds, between expected scheduling and real scheduling time. The default value is 180 seconds.
    hangcheck_reboot - determines if the hangcheck-timer restarts the node if the kernel fails to respond within the sum of the hangcheck_tick and hangcheck_margin parameter values. If the value of hangcheck_reboot is equal to or greater than 1, then the hangcheck-timer module restarts the system. If the hangcheck_reboot parameter is set to zero, then the hangcheck-timer module will not reboot the node, even if a hang is detected.   The default value varies by kernel version.  In the 2.4 kernel, the default is 1.  In 2.6 kernels, the default is 0.
Hangcheck-timer will provide message logging to the system messages log when a failure is detected, and a node restart is initiated by the module:
    When Hangcheck-timer reboots it may leave "Hangcheck: hangcheck is restarting the machine" message in /var/log/messages
    If you see the following message in /var/log/messages:  "Hangcheck: hangcheck value past margin!" this means a reboot was required but was not performed, because hangcheck_reboot was not set to 1.  If this message is seen, you must reload the hangcheck module as described earlier in this note, with the hangcheck_reboot value set to 1.
Note : Hangheck timer is not required starting with Oracle Clusterware 11gR2

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10867315/viewspace-713900/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10867315/viewspace-713900/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值