Linuxhotel Wiki

Wie ging das nochmal?

Benutzer-Werkzeuge

Webseiten-Werkzeuge


admin_grundlagen:chrony

Dies ist eine alte Version des Dokuments!


NTP

Chrony Client starten und automatisch anmelden:

chronyc -a

Zeit manuell setzen:

chronyc> manual on
chronyc> settime 9:30:00

Statistiken der Quellen der Netzwerkzeit anzeigen:

chronyc> sourcestats

NTP Aktivität anzeigen:

chronyc> activity

Informationen über die aktuellen Zeit-Quellen anzeigen:

chronyc> tracking

Auf die nächste Zeitsynchronization warten:

chronyc> waitsync

Die Systemzeit in (schnellen) Schritten anpassen:

chronyc> makestep

Informationen über die im Rechner eingebaute Echtzeituhr abfragen:

chronyc> rtcdata

Systemzeit in die RTC schreiben:

chronyc> trimrtc

Precision Time Protocol (PTP) im KVM Gast

1)

Kernel Modul ptp_kvm laden:

echo ptp_kvm > /etc/modules-load.d/ptp_kvm.conf
systemctl restart systemd-modules-load.service

erzeugt:

ls -l /dev/ptp*
/etc/chrony/chrony.conf
#pool 2.debian.pool.ntp.org iburst
refclock PHC /dev/ptp0 poll 2

chrony neu starten:

service chrony restart

Zeitquellen anzeigen:

chronyc sources

→ sollte nur noch PHC0 anzeigen, keine externen NTP-Quellen mehr

1)
After ptp_kvm initialized, there will be a new device node under
/dev/ptp*. A guest userspace service, like chrony, can use this
device to get host walltime, sometimes also counter cycle, which depends
on the service it calls. Then this guest userspace service can use those
data to do the time sync for guest.
here is a rough sketch to show how kvm ptp clock works.

|----------------------------|              |--------------------------|
|       guest userspace      |              |          host            |
|ioctl -> /dev/ptp%d         |              |                          |
|       ^   |                |              |                          |
|----------------------------|              |                          |
|       |   | guest kernel   |              |                          |
|       |   V      (get host walltime/counter cycle)                   |
|      ptp_kvm -> hypercall - - - - - - - - - - ->hypercall service    |
|                         <- - - - - - - - - - - -                     |
|----------------------------|              |--------------------------|
Quelle: Linux Kernel Mailingliste / Jianyong Wu ( https://lwn.net/Articles/830643/ )
admin_grundlagen/chrony.1683195151.txt.gz · Zuletzt geändert: 2023/05/04 10:12 von ingo_wichmann