安装软件:
CentOS:
yum install ntp
SUSE:
zypper in ntpd
vim /etc/ntp.conf
#从互联网同步,此为互联网ntp server
server cn.pool.ntp.org iburst
#从本地同步,此为本地ntp server
server 10.240.217.71 iburst
#使本机能作为ntp server提供ntp service
restrict default nomodify notrap nopeer noquery
手动执行第一次ntp
ntpdate cn.pool.ntp.org
使能ntp daemon
systemctl restart ntpd
使能开机运行dameon
systemctl enable ntpd
查看运行状况
ntpq -p