用ntp 网络同步 CentOS 系统时间

来源:互联网 发布:如何学好c语言程序 编辑:程序博客网 时间:2024/05/01 07:54

每台服务器的时间,随着时间的运行而会产生误差,为了减少误差所以要进行时间同步:

# Install ntpyum install ntp# Set the timezonerm -rf /etc/localtimeln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime# Synchronizationntpdate pool.ntp.org# Auto startecho "ntpdate pool.ntp.org" >> /etc/rc.local# Crontabcrontab -e0-59/10 * * * * /usr/sbin/ntpdate us.pool.ntp.org | logger -t NTP 


如此时间同步完成~~~