centos7如何同步【中国北京或上海的时间】实时校准的方法【解决时间相差8小时问题】
【生产环境必备时间同步方案】centos最权威的同步时间方法【ntp 时间同步】在生产环境中慎用ntpdate:https://blog.csdn.net/weixin_43343144/article/details/116847198
【临时解决办法-无法永久解决,系统的时间都是在变化的】当你的centos服务器使用ntpdate命令同步是总无法成功【ntpdate[22556]: no server suitable for synchronization found】则使用修改硬件的时间方法参考【已测试成功】:https://blog.csdn.net/qq_27127385/article/details/106230096
如果使用【ntpdate命令同步时间总是错误,可以使用httpdate代替】参考:https://blog.csdn.net/weixin_43343144/article/details/116843998
参考:https://www.cnblogs.com/yancun8141/p/10577922.html
参考:https://www.pianshen.com/article/8560429264/
国内外常用公共NTP网络时间服务器地址:https://blog.csdn.net/weixin_42588262/article/details/82501488
全球可用的NTP服务器列表与解析服务 -http://www.ntp.org.cn/pool
第一步:安装ntpdate工具
yum install ntpdate
第二步:
以下同步时间任意选择一个【测试time.windows.com是成功的】
ntpdate time.windows.com
其他,有些地址可能无法同步了!
ntpdate ntp1.aliyun.com
ntpdate asia.pool.ntp.org
ntpdate time.nuri.net
成功的提示:29 Jan 12:12:46 ntpdate[22903]: adjust time server 20.189.79.72 offset -0.000060 sec
失败的提示【同步时间的域名可能无法解析失败了,换一个域名在测试】:29 Jan 12:16:46 ntpdate[542]: no server suitable for synchronization found
# 每2小时同步一下时间【确保中国时间准确-这里选择同步多个,有些可能链接不成功】
0 */2 * * * root ntpdate time.windows.com
0 */2 * * * root ntpdate ntp.aliyun.com
最后一步:同步完成后务必写入硬件时间参考:https://blog.csdn.net/qq_27127385/article/details/106230096
hwclock --hctosys 设置系统时间和硬件时间同步【系统时间写入硬件】
hwclock -s 让系统时间和硬件时间保持一致
还没有评论,来说两句吧...