PRVF5436 : The NTP daemon running on one or more nodes lacks the slewing option "x"

 

 

接手了一套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.
 
 

 

20211122_01

出现上面错误提示,是因为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的集群服务。你可以一个节点一个节点处理。当然这个也是经过验证确认的。

 

下面是关于CTSSNTP的关系的相关知识点:

 

Oracle 11gR2 RAC开始使用Cluster Time Synchronization Service(CTSS)同步各节点的时间,当安装程序发现NTP协议处于非活动状态时,安装集群时间同步服务将以活动模式(active)自动进行安装并同步所有节点的时间。如果发现配置了NTP,则以观察者模式(observer mode)启动集群时间同步服务,Oracle Clusterware不会在集群中进行活动的时间同步。

 

RAC中,集群的时间应该是保持同步的,否则可能导致很多问题,例如:依赖于时间的应用会造成数据的错误,各种日志打印的顺序紊乱,这将会影响问题的诊断,严重的可能会导致集群宕机或者重新启动集群时节点无法加入集群。

 

Oracle 11gR2前,集群的时间是由NTP同步的,而在11gR2后,Oracle引入了CTSS组件,如果系统没有配置NTP,则由CTSS来同步集群时间。

NTPCTSS是可以共存的,且NTP的优先级要高于CTSS,也就是说,如果系统中同时有NTPCTSS,那么集群的时间是由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"

 

 

这套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

扫描上面二维码关注我
如果你真心觉得文章写得不错,而且对你有所帮助,那就不妨帮忙“推荐"一下,您的“推荐”和”打赏“将是我最大的写作动力!
本文版权归作者所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接.
原文地址:https://www.cnblogs.com/kerrycode/p/15605489.html