[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 192.168.1.128 prefer <<<<===========这里是时钟服务器
restrict 192.168.7.0 mask 255.255.255.255 nomodify notrap #基于网段的限制(限制在网段192.168.7.0)
broadcastdelay 0.008
[root@nascds11 ~]# vi /etc/ntp.conf
#New ntp server added by Robinson
server 192.168.7.71 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 6410.0000.000 0.001
[root@nascds11 ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
test.oracle.com .INIT. 16 u 60 6400.0000.000 0.000
LOCAL(0).LOCL. 10 l 59 6410.0000.000 0.001
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)