无法启动 NTP

无法启动 NTP

上周它工作正常,但现在,我的 virtualbox 内的虚拟机不同步了 5 分钟

$ systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/usr/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2015-09-30 18:52:31 WIB; 10s ago
     Docs: man:systemd-timesyncd.service(8)
 Main PID: 25684 (systemd-timesyn)
   Status: "Idle."
   CGroup: /system.slice/systemd-timesyncd.service
           └─25684 /usr/lib/systemd/systemd-timesyncd

$ timedatectl set-ntp true 

$ timedatectl status
      Local time: Wed 2015-09-30 18:54:17 WIB
  Universal time: Wed 2015-09-30 11:54:17 UTC
        RTC time: Wed 2015-09-30 11:46:27
       Time zone: Asia/Jakarta (WIB, +0700)
 Network time on: yes
NTP synchronized: no
 RTC in local TZ: no

$ cat /etc/systemd/timesyncd.conf

[Time]
NTP=0.asia.pool.ntp.org,1.asia.pool.ntp.org,2.asia.pool.ntp.org,3.asia.pool.ntp.org
FallbackNTP=0.arch.pool.ntp.org 1.arch.pool.ntp.org 2.arch.pool.ntp.org 3.arch.pool.ntp.org

是什么原因造成的NTP synchronized: no

我正在使用 64 位 ArchLinux 并且https://wiki.archlinux.org/index.php/Systemd-timesyncd

编辑啊现在可以了

$ sudo systemctl daemon-reload 
$ systemctl restart ntpd                                                                                                                                                                                                                                
$ systemctl restart systemd-timesyncd
$ systemctl restart ntpd
$ timedatectl status                                                                                                                                                                                                                                    
      Local time: Wed 2015-09-30 18:56:49 WIB
  Universal time: Wed 2015-09-30 11:56:49 UTC
        RTC time: Wed 2015-09-30 11:56:49
       Time zone: Asia/Jakarta (WIB, +0700)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

答案1

您正在尝试在虚拟机上运行完整的 ntp 服务器。 ntp 和虚拟机不能很好地协同工作,因为模拟时钟违反了 ntp 所做的假设。而是在主机上运行 ntp,在虚拟机上运行 sntp 以同步到主机。这不太准确,但不存在在虚拟机上运行 ntp 的同步问题。

相关内容