Chrony

 Chrony es un paquete que se puede usar como aternativa a ntp para la sincronización rapida de los relojes de moviles y sistemas virtualesInstall the Chrony service.

Por defecto viene instalado en Centos 7.

Si es necesario instalarlo:

syum install -y chrony

Para activar el servicio en el arranque:

systemctl enable chronyd

Arrancar el sevicio:

systemctl start chronyd

El fichero de configuración se encuentra en  /etc/chrony.conf:

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift
# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
makestep 1.0 3
# Enable kernel synchronization of the real-time clock (RTC).
rtcsync
# Enable hardware timestamping on all interfaces that support it.
#hwtimestamp *
# Increase the minimum number of selectable sources required to adjust
# the system clock.
#minsources 2
# Allow NTP client access from local network.
#allow 192.168.0.0/16
# Serve time even if not synchronized to a time source.
#local stratum 10
# Specify file containing keys for NTP authentication.
#keyfile /etc/chrony.keys
# Specify directory for log files.
logdir /var/log/chrony
# Select which information is logged.
#log measurements statistics tracking

Para obtener informaciión del servidor:

chronyc tracking
Reference ID    : 939C071A (scott.red.uv.es)
Stratum         : 3
Ref time (UTC)  : Sun Oct 29 15:16:21 2017
System time     : 0.000949730 seconds slow of NTP time
Last offset     : -0.001051502 seconds
RMS offset      : 0.021652669 seconds
Frequency       : 529.805 ppm fast
Residual freq   : +0.098 ppm
Skew            : 18.155 ppm
Root delay      : 0.067827091 seconds
Root dispersion : 0.030951364 seconds
Update interval : 64.4 seconds
Leap status     : Normal

Para obtener una información equivalente a la que proporciona el comando  ntpq:

chronyc sources -v
210 Number of sources = 4
  .-- Source mode  '^' = server, '=' = peer, '#' = local clock.
 / .- Source state '*' = current synced, '+' = combined , '-' = not combined,
| /   '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
||                                                 .- xxxx [ yyyy ] +/- zzzz
||                                                /   xxxx = adjusted offset,
||         Log2(Polling interval) -.             |    yyyy = measured offset,
||                                  \            |    zzzz = estimated error.
||                                   |           |
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^+ bjaaland.ci.uv.es             2   6   177    59   +3442us[+3442us] +/- 59ms
^+ roasf2.roa.es                 2   6   374   254    -143ms[ -144ms] +/- 196ms
^* scott.red.uv.es               2   6   377    62     -30us[+1019us] +/- 71ms
^+ ntp.redimadrid.es             2   6   377    61    -774us[ -774us] +/-
chronyc sourcestats -v
210 Number of sources = 4
                             .- Number of sample points in measurement set.
                            /    .- Number of residual runs with same sign.
                           |    /    .- Length of measurement set (time).
                           |   |    /      .- Est. clock freq error (ppm).
                           |   |   |      /           .- Est. error in freq.
                           |   |   |     |           /         .- Est. offset.
                           |   |   |     |          |          |   On the -.
                           |   |   |     |          |          |   samples. \
                           |   |   |     |          |          |             |
Name/IP Address            NP  NR  Span  Frequency  Freq Skew  Offset    Std Dev
=================================================================================
bjaaland.ci.uv.es           1   0     0      +0.000   2000.000     +0ns   4000ms
roasf2.roa.es               5   3    72     +30.645   3658.466  -2321us     19ms
scott.red.uv.es             5   3    72    +114.202   2255.691  +1218us     12ms
3.centos.pool.ntp.org       5   3    71     +15.541    258.169  -3219us   1171us

Para una sincronización rápida no hace falta parar el servicio y se utiliza el comando:

ntpdate pool.ntp.org
5 Jul 10:31:06 ntpdate[2135]: step time server 193.55.167.1 offset 121873.493146 sec
Anuncios

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión /  Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión /  Cambiar )

Conectando a %s