如何在各个平台上配置NTP的微调模式.doc
文本预览下载声明
如何在各个平台上配置NTP的微调模式
如何在各个平台上配置NTP的微调模式
对于11.2之前的版本,很多环境的重启原因(top5的情况)是由于NTP调整时间的步伐过大导致的,
所以RAC环境中,我们建议用户如果使用NTP,需要配置成微调模式;
具体重启的原因,请大家参考Allen Gao写的博客 :如何诊断节点重启问题
这里介绍几个主流linux和unix平台上NTP微调的配置方法:
For Linux :
1.请确确认各节点的ntp包已经安装 ,我这里是个4.2.2的版本
[oracle@nascds10 ~]$ rpm -qa | grep ntp
ntp-4.2.2p1-9.el5_4.1
2.请编辑各个节点的ntp.conf文件
[oracle@nascds10 ~]$ su - root
Password:
[root@nascds10 ~]# vi /etc/ntp.conf
#New ntp server added by Robinson
server 28 prefer ===========这里是时钟服务器
restrict mask 55 nomodify notrap #基于网段的限制(限制在网段)
broadcastdelay 0.008
[root@nascds11 ~]# vi /etc/ntp.conf
#New ntp server added by Robinson
server 1 prefer
broadcastdelay 0.008
3、配置ntpd的参数,我们主要强调的是要配置成微调的模式 也就是在options中要加入 -x的选项
[root@nascds10 ~]# vi /etc/sysconfig/ntpd
#The following item added by Robinson
#Set to yes to sycn hw clock after successful ntpdate
SYNC_HWCLOCK=yes
OPTIONS=-x -u ntp:ntp -p /var/run/ntpd.pid
[root@nascds11 ~]# vi /etc/sysconfig/ntpd
The following item added by Robinson
SYNC_HWCLOCK=yes
OPTIONS=-x -u ntp:ntp -p /var/run/ntpd.pid
4、自动启动配置
[root@nascds10 ~]# chkconfig ntpd on
[root@nascds11 ~]# chkconfig ntpd on
5、重启一下,使最新配置生效
[root@nascds10 ~]# service ntpd restart
Shutting down ntpd: [ OK ]
ntpd: Synchronizing with time server: [ OK ]
Syncing hardware clock to system time [ OK ]
Starting ntpd: [ OK ]
[root@nascds11 ~]# service ntpd restart
Shutting down ntpd: [ OK ]
ntpd: Synchronizing with time server: [ OK ]
Syncing hardware clock to system time [ OK ]
Starting ntpd: [ OK ]
6、检查ntpd进程的状态
[root@nascds10 ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
LOCAL(0) .LOCL. 10 l 40 64 1 0.000 0.000 0.001
[root@nascds11 ~]# ntpq -p
remote refid
显示全部