centos 同步北京时间
deng_chaowang  • 7年前  • 147 次浏览  • Java团队  

部署ntp服务端 yum install ntp -y 

编辑ntp的配置文件vi /etc/ntp.conf (日志文件默认在/var/log/messages中),添加以下几个服务器域名,有些服务默认自带,无需添加一下参数server 0.centos.pool.ntp.org iburst server 1.centos.pool.ntp.org iburst server 2.centos.pool.ntp.org iburst server 3.centos.pool.ntp.org iburst

设置中国时区: timedatectl set-timezone Asia/Shanghai    #执行完后时间还需要重启ntpd服务

systemctl restart ntpd 

systemctl enable ntpd


回到顶部