GNU/Linux >> Linux Esercitazione >  >> Cent OS

Come installare il servizio NTP e il client in CentOS/RHEL 8

In CentOS/RHEL 8, ntp non è più supportato. chrony è abilitato per impostazione predefinita. Per questo motivo, potrebbe essere necessario migrare da ntp a chrony.

Nota :In CentOS/RHEL 7 gli utenti potevano scegliere tra ntp e chrony. Ma a partire da CentOS/RHEL 8, devono usare chrony invece di ntp.

Nei server CentOS/RHEL 8 standard, chrony dovrebbe essere già installato e attivo. Può essere verificato eseguendo:

# systemctl status chronyd

● chronyd.service - NTP client/server
  Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
  Active: active (running) since Mon 2021-01-25 16:31:25 GMT; 2 days ago
  Docs: man:chronyd(8)
  man:chrony.conf(5)
  Process: 1401 ExecStartPost=/usr/libexec/chrony-helper update-daemon (code=exited, status=0/SUCCESS)
  Process: 1388 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 1397 (chronyd)
  Tasks: 1 (limit: 100197)
  Memory: 2.0M
  CGroup: /system.slice/chronyd.service
  └─1397 /usr/sbin/chronyd

Il comando chronyc può essere utilizzato come client, ad esempio per verificare la presenza di sorgenti esistenti con:

# chronyc sources

210 Number of sources = 1
MS  Name/IP address  Stratum Poll Reach LastRx Last sample
===============================================================================
^*  xxx.xxx.xxx.xxx  2 10 377 130 -40us[ -71us] +/- 36ms

E nell'improbabile eventualità che chrony non sia installato, il pacchetto può essere installato tramite yum, installando chrony:

# yum install chrony

NTP vs Chrony

Di seguito è riportato un riepilogo del confronto tra NTP e chrony:

nome ntp nome cronico
/etc/ntp.conf /etc/chrony.conf
/etc/ntp/keys /etc/chrony.keys
ntpd cronide
ntpq cronico
ntpd.service chronyd.service
ntp-wait.service chrony-wait.service

Migrazione da NTP a chrony

RedHat fornisce uno script piacevole che può convertire direttamente le impostazioni NTP in chrony. Lo script /usr/share/doc/chrony/ntp2chrony.py incluso per impostazione predefinita insieme a chrony in CentOS/RHEL 8. Lo script converte automaticamente una configurazione ntp esistente in chrony.

Di seguito è riportato un esempio di conversione della configurazione NTP in chrony utilizzando lo script:

# python3 /usr/share/doc/chrony/ntp2chrony.py -b -v
Reading /etc/ntp.conf
Reading /etc/ntp/crypto/pw
Reading /etc/ntp/keys
Writing /etc/chrony.conf
Writing /etc/chrony.keys

Ecco,
-b – esegue il backup dell'originale /etc/chrony.conf o /etc/chrony.keys prima di apportare modifiche.
-v – stampa versbose.

Eventuali direttive non supportate da ntp.conf sono incluse in chrony.conf come commenti.


Cent OS
  1. Come installare Chrony NTP Server su CentOS 8

  2. Come installare Python 3.5 su CentOS/RHEL e Fedora

  3. CentOS / RHEL:come installare e avviare il servizio httpd di Apache

  4. CentOS / RHEL 7 :Come installare e configurare telnet

  5. CentOS / RHEL 7:come installare e configurare il server ftp (vsftpd)

Come installare il server VNC su CentOS 8 / RHEL 8

Come installare e utilizzare Firewalld in CentOS/RHEL

Come installare Samba su RHEL e CentOS Stream

Come installare e configurare Jenkins su CentOS 8 / RHEL 8

Come installare Wine 5.0 su CentOS, RHEL e Fedora

Come installare e configurare il server VNC (TigerVNC) in CentOS / RHEL 7