ntp

Description

NTP, the Network Time Protocol, is used to keep computer clocks accurate
by synchronizing them over the Internet or a local network, or by
following an accurate hardware receiver that interprets GPS, DCF-77,
NIST or similar time signals.
.
This charm can be deployed alongside principal charms to enable NTP
management across deployed services.

Overview

Network Time Protocol (NTP) is a network-based time service to ensure
synchronization of time across a network of computers. It is defined in
RFC5905.

Usage

The ntp charm is a subordinate charm which is designed for use with other
principal charms. In its basic mode, the ntp charm is used to configure NTP
in service units to talk directly to a set of NTP time sources:

juju deploy cs:ntp
juju add-relation ntp myservice

By default this charm uses the standard set of NTP pool servers which are
configured in Ubuntu. In the event that you don't wish every juju unit on your
network to talk directly to the public NTP pool on the Internet, there are
several options.

Manual

If you already have a set of reliable, non-juju NTP servers in your network,
simply configure them as sources or peers and disable the default list of pool
servers. For example:

Multiple strata

In network environments where general outbound network access to the Internet
is not avaliable or you don't have a good internal time source such as an
atomic clock, you can use selected juju units to act as an NTP service for
other units.

Auto peers

Auto peers implements multiple strata automatically, by testing upstream NTP
connectivity, selecting the units with the best connectivity to comprise
the upstream stratum, and configuring the remaining hosts to receive time from
those units.

NTP Implementations

Under Ubuntu 17.10 (Artful Aardvark) and earlier, the default implementation
of NTP is ntpd, from the Network Time Foundation. Ubuntu 18.04 (Bionic
Beaver) moves to chrony as the default NTP implementation. These decisions
are also reflected in this charm.

Monitoring

This charm may be related to the NRPE charm for monitoring by Nagios.
The telegraf charm also includes support for gathering NTP metrics.

(string)
Used by the nrpe subordinate charms.
A string that will be prepended to instance name to set the host name
in nagios. So for instance the hostname would be something like:
juju-myservice-0
If you're running multiple environments with the same services in them
this allows you to differentiate between them.

(int)
The stratum at which NTP must lose connectivity to before it considers itself orphaned, and starts determining the reference time with local peers. A typical value is 6, which will enable orphaned operation when there are no stratum 6 servers or servers of a higher stratum available, which is two strata below most Internet NTP hosts. Set to 0 to disable orphan mode entirely. You must enable at least one peer in order to use orphan mode, but four or more is recommended for best results.