Oracle RAC集群时间同步告警PRVF-5436&PRVF-9652
本文转载自微信公众号「DBA闲思杂想录」,作者潇湘隐者。转载本文请联系DBA闲思杂想录公众号。
接手了一套RAC数据库(Oracle 11g),结果在巡检的时候发现集群节点间的时钟同步有下面告警信息,如下所示:
- $ cluvfy comp clocksync -verbose
- Verifying Clock Synchronization across the cluster nodes
- Checking if Clusterware is installed on all nodes...
- Check of Clusterware install passed
- Checking if CTSS Resource is running on all nodes...
- Check: CTSS Resource running on all nodes
- Node Name Status
- ------------------------------------ ------------------------
- oracle1 passed
- Result: CTSS resource check passed
- Querying CTSS for time offset on all nodes...
- Result: Query of CTSS for time offset passed
- Check CTSS state started...
- Check: CTSS state
- Node Name State
- ------------------------------------ ------------------------
- oracle1 Observer
- CTSS is in Observer state. Switching over to clock synchronization checks using NTP
- Starting Clock synchronization checks using Network Time Protocol(NTP)...
- NTP Configuration file check started...
- The NTP configuration file "/etc/ntp.conf" is available on all nodes
- NTP Configuration file check passed
- Checking daemon liveness...
- Check: Liveness for "ntpd"
- Node Name Running?
- ------------------------------------ ------------------------
- oracle1 yes
- Result: Liveness check passed for "ntpd"
- Check for NTP daemon or service alive passed on all nodes
- Checking NTP daemon command line for slewing option "-x"
- Check: NTP daemon command line
- Node Name Slewing Option Set?
- ------------------------------------ ------------------------
- oracle1 no
- Result:
- NTP daemon slewing option check failed on some nodes
- PRVF-5436 : The NTP daemon running on one or more nodes lacks the slewing option "-x"
- Result: Clock synchronization check using Network Time Protocol(NTP) failed
- PRVF-9652 : Cluster Time Synchronization Services check failed
- Verification of Clock Synchronization across the cluster nodes was unsuccessful on all the specified nodes.
出现上面错误提示,是因为RAC集群服务器的NTP服务没有启用-x选项,如果没有开启slewing 选项,在时间差异超过特定(取决于平台)阈值时,NTP 将向前或向后调整系统时钟。大幅度向后调整时间会导致 Clusterware 以为错过了签到,从而发生节点驱逐的情况。出于此原因,强烈建议将 NTP 配置调整为slewing time (加快或减慢)时钟时间以同步时间,以防止此类驱逐情况的发生。
What is slewing?
The NTP daemon will periodically update the system clock with the time from a reference clock. If the time on the reference clock is behind the time on the system clock, the system clock will be set backwards in one large decrement. Such swift changes in time can lead to Oracle shutting down the node due to inconsistent timers. To avoid this problem, NTP can be configured to slew the clock. When slewing the clock the time on system is incremented slower until the system clock is in sync with the time on the reference system.
“-x”选项用于阻止ntp向后调整时钟,向后则意味着时间回逆,可能导致数据库、集群出现重启.驱逐等问题。
之前维护这套RAC的人可能在安装的时候就从未留意过这个问题,那么问题来了,如果是安装、调试阶段,直接修改配置,重启NTP服务就完事了,但是现在这套RAC正在对外提供关键服务,那么可以重启NTP服务吗?会不会引发什么问题呢?
答案是不会,如果两个(或多个)节点之间没有时间差,完全可以重启NTP服务,不影响RAC的集群服务。你可以一个节点一个节点处理。当然这个也是经过验证确认过的。
下面是关于CTSS与NTP的关系的相关知识点:
从Oracle 11gR2 RAC开始使用Cluster Time Synchronization Service(CTSS)同步各节点的时间,当安装程序发现NTP协议处于非活动状态时,安装集群时间同步服务将以活动模式(active)自动进行安装并同步所有节点的时间。如果发现配置了NTP,则以观察者模式(observer mode)启动集群时间同步服务,Oracle Clusterware不会在集群中进行活动的时间同步。
在RAC中,集群的时间应该是保持同步的,否则可能导致很多问题,例如:依赖于时间的应用会造成数据的错误,各种日志打印的顺序紊乱,这将会影响问题的诊断,严重的可能会导致集群宕机或者重新启动集群时节点无法加入集群。
在Oracle 11gR2前,集群的时间是由NTP同步的,而在11gR2后,Oracle引入了CTSS组件,如果系统没有配置NTP,则由CTSS来同步集群时间。NTP和CTSS是可以共存的,且NTP的优先级要高于CTSS,也就是说,如果系统中同时有NTP和CTSS,那么集群的时间是由NTP同步的,CTSS会处于观望(Observer)模式,只有当集群关闭所有的NTP服务,CTSS才会处于激活(Active)模式。在一个集群中,只要有一个节点的ntp处于活动状态,那么集群的所有节点的CTSS都会处于激活(Active)模式。需要注意的是,要让CTSS处于激活(Active)模式,则不仅要关闭ntp服务(/sbin/service ntpd stop),还要删除/etc/ntp.conf文件(mv /etc/ntp.conf /etc/ntp.conf.bak),否则不能启用CTSS。
具体操作步骤如下:
- # more /etc/sysconfig/ntpd
- # Drop root to id 'ntp:ntp' by default.
- OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid -g"
修改/etc/sysconfig/ntpd的配置
修改前
- OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid -g"
修改后
- OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid -g"
RAC集群的操作系统是RHEL 6,它的服务是通过service启动,所以通过下面命令重启NTP服务解决问题:
- service ntpd restart
参考资料:
https://www.oracledistilled.com/grid-infrastructure/prvf-5439-ntp-daemon-does-not-have-slewing-option-%E2%80%9C-x%E2%80%9D-set-on-node/
https://www.cnblogs.com/lhrbest/p/9253449.html
相关文章
- 英特尔酷睿i9-13900T跑分曝光:35W性能比125W的i9-12900K还要强!
- 台湾芯片出口同比增长18.4%,龙头地位短期内不可替代
- 台积电3nm良率仅50%?是韩媒在故意贬低?
- 模拟IC最快二季度回温,价格仍将继续下跌
- 传三星将缩减晶圆代工投资,此前已减少半导体硅片采购量
- 不满美国施压!荷兰官员:不会轻易同意对华芯片技术出口新限制
- 联电Q1产能利用率将降至70%,但不会降价
- 两家中企进入全球CIS市场前五,合力拿下13.7%份额!
- Native Instruments Kontakt 7 for Mac(音频采样器)
- 晶圆代工市场最新排名:台积电以60%份额稳居第一,中芯国际份额降至5%!
- SEMES前员工窃密案新进展:4人被捕,20台设备及技术卖给中企,获利6.5亿元!
- 投资20.6亿元,晶圆切割设备厂DISCO拟扩产四成
- 国产特斯拉降价后:日均销量同比猛增近80%
- 2022年全球前十大半导体厂商排名公布
- 华为昇腾AI芯片获得大幅优化:7倍性能于苹果M1处理器
- 苹果M2 Pro / M2 Max发布:性能提升至全新高度!
- 地平线与文远知行达成战略合作,征程5芯片赋能打造L4级智能驾驶解决方案
- 英特尔将在今年底量产Intel 3制程
- 韩国半导体库存最高达30周,SK海力士及三星2023年恐面临亏损
- 需求持续下滑,2023年全球晶圆代工产值将下滑4%