juju deploy ntpmaster
Discuss this charm
Share your thoughts on this charm with the community on discourse.
NTP provides network based time services to ensure synchronization of time across computers.
The ntpmaster charm provides NTP based services to other charms - either directly or through the use of the ntp subordinate charm.
This this mode services need to understand how to relate to the ntpmaster service using the ntp protocol:
juju deploy ntpmaster juju add-relation ntpmaster myservicethatwantsntp
This is less useful as every charm has to have master hooks.
In this mode the ntp subordinate charm is used to configure NTP in other service units to the ntpmaster service:
juju deploy ntp juju deploy ntpmaster juju deploy myservicethatdoesnotunderstandntp juju add-relation ntp ntpmaster juju add-relation ntp myservicethatdoesnotunderstandntp
You can of course have more that one ntpmaster:
juju add-unit -n 2 ntpmaster
All services that the ntp charm is subordinate to will be configured to sync with all avaliable ntp masters.
The ntpmaster charm by default will use the standard NTP pool servers that are provided by the Ubuntu package. It can also be configured to use specific servers:
juju set ntpmaster source="myserver1 myserver2 myserver3"
This would allow use with an internal time source, such as GPS or an atomic clock, or with alternative external NTP sources.
If the ntpmaster is supposed to be its own reference, use "source=LOCAL" in order to generate a local reference clock configuration file for this server.