参考

http://acooly.iteye.com/blog/1993484

对于一个联网的机器

service ntpd restart
chkconfig ntpd on

如果在内网,一台机器想做ntp服务器

driftfile /var/lib/ntp/drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1 
restrict -6 ::1
restrict 0.0.0.0 mask 0.0.0.0 nomodify notrap
server 133.100.11.8 perfer   # 中国国家受时中心
server 202.112.10.36             # 1.cn.pool.ntp.org
server 59.124.196.83             # 0.asia.pool.ntp.org
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys

如果想做ntpclient,和本地的ntp服务器同步

ntpdate -u 10.9.62.11

或者

driftfile /var/lib/ntp/drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1 
restrict -6 ::1
server 10.9.62.11
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
yum install -y ntp
service ntp restart
chkconfig ntp on
ntpq -p

机器时间同步测试

ntpq -p

mark

Copyright © opschina.org 2017 with zzlyzq@gmail.com all right reserved,powered by Gitbook该文件修订时间: 2017-07-11 11:32:48

results matching ""

    No results matching ""