qixing

使用VMware虚拟机由于电脑关机时,虚拟机没关闭,导致虚拟机被挂起,再打开电脑继续运行虚拟机时,时间就变为上次关闭电脑的时间,导致虚拟机时间不对,下面使用ntp来处理时间同步问题

1.安装ntp

 yum -y install ntp

2.设置开机自启并启动ntp服务

systemctl enable ntpd
systemctl start ntpd

3.使用命令同步时间

ntpdate -u cn.pool.ntp.org

 4.使用crontab定时自动同步时间

echo "*/20 * * * * /usr/sbin/ntpdate -u ntp1.aliyun.com >/dev/null &" >> /var/spool/cron/root

5.常用的ntp服务器

国内:

cn.pool.ntp.org  中国开源免费NTP服务器
ntp1.aliyun.com 阿里云NTP服务器
ntp2.aliyun.com 阿里云NTP服务器
time1.aliyun.com 阿里云NTP服务器
time2.aliyun.com 阿里云NTP服务器

国外:

time1.apple.com 苹果NTP服务器
time2.apple.com 苹果NTP服务器
time3.apple.com 苹果NTP服务器
time4.apple.com 苹果NTP服务器
time5.apple.com 苹果NTP服务器
time1.google.com 谷歌NTP服务器
time2.google.com 谷歌NTP服务器
time3.google.com 谷歌NTP服务器
time4.google.com 谷歌NTP服务器
pool.ntp.org 开源免费NTP服务器

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-12-26
  • 2021-08-28
  • 2021-10-30
  • 2022-01-01
猜你喜欢
  • 2021-06-09
  • 2022-12-23
  • 2021-06-29
  • 2022-12-23
  • 2021-12-25
  • 2021-12-25
相关资源
相似解决方案