注意:请自行替换时间同步服务器ntpServer的具体ip或者网址,公网可以使用 阿里巴巴:ntp。aliyun。com 腾讯云:servertime1。cloud。tencent。com 微软:time。windows。com 苹果:time。apple。comFORUbuntu16。041。安装ntpdate软件,已安装的请忽略aptgetinstallyntpdate2。设置定时同步策略crontabe添加一行每天1点1分执行时间同步1usrsbinntpdatentpServer3。执行立即同步usrsbinntpdatentpServerFORCentos671。安装ntpdate软件,已安装的请忽略yuminstallyntpdate2。设置定时同步策略crontabe添加一行每天1点1分执行时间同步1usrsbinntpdatetime。tamp。com3。执行立即同步usrsbinntpdatetime。tamp。comFORCentos81。安装chrony软件,已安装的请忽略yuminstallychrony2。启动systemctlstartchronyd3。设为系统自动启动systemctlenablechronyd4。编辑配置文件vimetcchrony。conf注释掉如下这行:pool2。centos。pool。ntp。orgiburst添加如下一行:serverntpServer5。重新加载配置systemctlrestartchronyd。service6。执行立即同步chronycsourcesv