centos7时间同步

用ntpdate从时间服务器更新时间

1.如果你的linux系统根本没有ntpdate这个命令

yum install -y ntp

2.安装完了之后,你不要做什么配置,也不需要,直接测试一下

[root@git conf.d]# ntpdate asia.pool.ntp.org
21 Mar 10:52:01 ntpdate[9247]: step time server 209.58.185.100 offset 38761.507576 sec

3.如果出去上面的内容说明,同步成功了。然后在crontab里面加上以下内容。

*/10 * * * * ntpdate asia.pool.ntp.org

4.推荐几个时间服务器

time.nist.gov
time.nuri.net
asia.pool.ntp.org
asia.pool.ntp.org
asia.pool.ntp.org
asia.pool.ntp.org

  

posted @ 2017-03-21 10:58  雪之谷  阅读(5716)  评论(0编辑  收藏  举报