NTP服务配置

来源:互联网 发布:数据透视表在哪 编辑:程序博客网 时间:2024/06/05 19:49

写于2013年秋,CentOS6.4

服务器端

[hadoop@master1 ~]$ sudo chkconfig ntpd on[hadoop@master ~]$ sudo vi /etc/ntp.confserver  127.127.1.0     # local clockfudge   127.127.1.0 stratum 10[hadoop@master1 ~]$ sudo service ntpd start

客户端

[hadoop@master2 ~]$ sudo crontab -e0 */1 * * * /usr/sbin/ntpdate ntp && /sbin/hwclock -w

在五分钟内会报:no server suitable for synchronization found,是因为NTP server需要跟其他服务器同步,包括自己

报“the NTP socket is in use, exiting”是因为本机ntpd服务已起,关掉即可。

sudo service ntpd stop  #关掉服务sudo chkconfig ntpd off  #去掉重启自启动
0 0