yum -y install ntp
chkconfig --level 235 ntpd
service ntpd start
date
If we want to manually sync server time with a time server, then we need to stop ntpd service first, then use ntpdate to sync time:
service ntpd stop
ntpdate 0.centos.pool.ntp.org
ntpdate 0.pool.ntp.org
date
No comments:
Post a Comment