虚拟化容器,大数据,DBA,中间件,监控。

Linux 平台下Oracle 9i/10g/11gR1 IO-Fencing 的hangcheck-timer 模块说明

28 10月
作者:admin|分类:DBA运维

Linux 平台下Oracle 9i/10g/11gR1 IO-Fencing 的hangcheck-timer 模块说明


二.说明

Hangcheck-timer 是Linux 提供的一个内核级的IO-Fencing 模块, 这个模块会监控Linux 内核运行状态, 如果长时间挂起, 这个模块会自动重启系统。

这个模块在Linux内核空间运行, 不会受系统负载的影响。 这个模块会使用CPU的Time Stamp Counter(TSC) 寄存器,这个寄存器的值会在每个时钟周期自动增加,

因此使用的是硬件时间,所以精度更高。配置这个模块需要2个参数:hangcheck_tick 和 hangcheck_margin。 

hangcheck_tick用于定义多长时间检查一次,缺省值是30秒。 有可能内核本身很忙, 导致这个检查被推迟, 该模块还允许定义一个延迟上限,就是hangcheck_margin, 它的缺省值是180秒。 

Hangcheck-timer 模块会根据hangcheck_tick 的设置,定时检查内核。只要2次检查的时间间隔小于 hangcheck_tick +hangchec_margin, 都会认为内核运行正常,否则就意味着运行异常,这个模块会自动重启系统。 

CRS本身还有一个MissCount 参数,可以通过crsctl get css miscount 命令查看。 

当RAC结点间的心跳信息丢失时, Clusterware 必须确保在进行重构时,故障结点确实是Dead 状态,否则结点仅是临时负载过高导致心跳丢失,

然后其他结点开始重构,但是结点没有重启,这样会损坏数据库。 因此MissCount 必须大于 hangcheck_tick+hangcheck_margin的和。 

2.1 hangcheck-timer.ko模块安装

hangcheck-timer被默认安装在linux版本 2.4.9-e.12 及之上版本中,可以用如下命令核查hangcheck-timer是否安装。 

[root@rac1 ~]#  find /lib/modules-name "hangcheck-timer.ko"

/lib/modules/2.6.18-164.el5/kernel/drivers/char/hangcheck-timer.ko

/lib/modules/2.6.18-164.el5xen/kernel/drivers/char/hangcheck-timer.ko

有以上输出,代表已经安装了。 

2.2 配置hangcheck-timer 模块

配置hangcheck-timer参数, 在/etc/modprobe.conf 中添加如下内容,这里根据数据库版本不同,内容也不同。

(1)9i: 假如"Oracle misscount"的缺省设置是220秒,则hangcheck_tick=30hangcheck_margin=180 hangcheck_reboot=1

210g/11gR1: 假如"CSS misscount"的设置是30或者60秒,则hangcheck_tick=1hangcheck_margin=10 hangcheck_reboot=1 

如:

[root@rac1 ~]# vi /etc/modprobe.conf

options hangcheck-timer hangcheck_tick=30hangcheck_margin=180

2.3 配置系统启动时自动加载模块

在/etc/rc.d/rc.local 中添加如下内容

[root@rac1 ~]# modprobe hangcheck-timer

[root@rac1 ~]# vi /etc/rc.d/rc.local

modprobe hangcheck-timer

2.4确认模块加载成功

[root@rac1 ~]# grep Hangcheck/var/log/messages | tail -2

Sep  7 19:53:03 rac1 kernel:Hangcheck: starting hangcheck timer 0.9.0 (tick is 180 seconds, margin is 60seconds).

Sep  7 19:53:03 rac1 kernel:Hangcheck: Using monotonic_clock().

查证hangcheck-timer的参数是否正确的方法

[root@rac2 ~]# /sbin/lsmod |grep hangcheck
hangcheck_timer         7897  0

一般rac这几个参数的设置一般如下:

misscount=220

hangcheck_tick=30

hangcheck_margin=180

浏览1881 评论0
返回
目录
返回
首页
CentOS 5.X64 Oracle 10G PRKC-1044 错误 RHEL5.4 RAC multipath 配置raw,运行root.sh Failed to upgrade Oracle Cluster Registry configuration