每台服务器的时间,随着时间的运行而会产生误差,为了减少误差所以要进行时间同步:
# Install ntp
yum install ntp
# Set the timezone
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# Synchronization
ntpdate pool.ntp.org
# Auto start
echo "ntpdate pool.ntp.org" >> /etc/rc.local
# Crontab
crontab -e
0-59/10 * * * * /usr/sbin/ntpdate us.pool.ntp.org | logger -t NTP
如此时间同步完成~~~
本文介绍如何在服务器上安装并配置ntp服务,实现时间同步。包括安装ntp、设置时区、同步时间、自动启动和定时任务。

被折叠的 条评论
为什么被折叠?



