每台服务器的时间,随着时间的运行而会产生误差,为了减少误差所以要进行时间同步:
# 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
如此时间同步完成~~~