centos7虚拟机时间和本地时间相差8小时


安装ntp和ntpdate

在安装centos7虚拟机的时候,已经将时区设置为了Asia/shanghai,但还是出现时间不准,相差了8小时
可以安装ntp和ntpdate,使用 NTP 公共时间服务器池(NTP Public Pool Time Servers)http://www.pool.ntp.org 同步你的服务器时间。

安装步骤

  1. 安装:sudo yum install ntpdate ntp -y
  2. 允许服务:sudo systemctl enable ntpd && sudo systemctl enable ntpdate
  3. 开启服务:sudo systemctl start ntpdate && sudo systemctl start ntpd


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM