ntp时间同步简介

网络时间协议(Network Time Protocol)

安装

# sudo apt-get install ntp

官网下载:http://www.ntp.org/downloads.html
本地加速下载:http://download.csdn.net/download/zhangxuechao_/9861088

ntpd
配置文件:

# vi /etc/ntp.conf

ntpdate
更新失败:

# sudo ntpdate cn.pool.ntp.org
 4 Jun 22:33:39 ntpdate[10076]: the NTP socket is in use, exiting

解决办法:

# /etc/init.d/ntp stop
# sudo ntpdate cn.pool.ntp.org
 4 Jun 22:39:19 ntpdate[10240]: step time server 173.255.246.13 offset 2075762.306339 sec
# /etc/init.d/ntp start 

ntpd和ntpdate的区别
ntpd不仅仅是时间同步服务器,还可以做客户端与标准时间服务器进行同步时间,而且是平滑同步;而ntpdate立即同步

原文地址:https://www.cnblogs.com/zhangxuechao/p/11709668.html