Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Configures an HA and highly consistent NTP Cluster synced to wall clock time

Notifications You must be signed in to change notification settings

evertrue/ntp_cluster-cookbook

Repository files navigation

ntp_cluster-cookbook

Build Status

Provides automated discovery and configuration of a private NTP cluster via Chef.

Usage

This cookbook will automagically assign master and standby nodes in the cluster. The first provisioned server will set itself as a master. Additional servers will find this server (using Chef Search) and configure themselves as standby peers.

If two masters are created at the same time (e.g. because nodes are provisioned in parallel), the node with the first name in alphabetical order will take precedence.

Decommissioning Master Servers

  1. Delete the node and client from the chef-server.
  2. Converge 1 of your standby servers so that it will promote itself to master
  3. Verify that the new master has been selected by performing knife search 'tags:ntp_master'
  4. Converge the rest of your standbys
  5. Converge all of your servers so that they stop looking to the old master
  6. Burn down the old master

Supported Platforms

  • Ubuntu 14.04

Attributes

All attributes fall under the node['ntp_cluster'] key.

Key Description Default
['discovery'] String: The Chef Search query to find ntp servers role:#{node['ntp_cluster']['server_role']}
['public_servers'] Array: The List of external servers to sync with %w( 0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org )
['verify']['retries'] Integer: NTP Pool connectivity checker number of retries 12
['verify']['retry_delay'] Integer: NTP Pool connectivity checker number of seconds between retries 5

Usage

ntp_cluster::default

Include this recipe in a wrapper cookbook:

depends 'ntp_cluster'

And then in your wrapper cookbook

include_recipe 'ntp_cluster::default'

Diagrams

The following diagrams should hopefully clarify the expected behavior of a properly configured cluster

Normal Operation

screen shot 2016-09-15 at 5 01 17 pm

Failed Master

screen shot 2016-09-15 at 5 01 35 pm

screen shot 2016-09-15 at 5 01 27 pm

Failed Master and 1 Failed Slave

screen shot 2016-09-15 at 5 01 42 pm

Network Segmentation

screen shot 2016-09-15 at 5 00 59 pm

License and Authors

Author:: Evertrue, Inc. ([email protected])

About

Configures an HA and highly consistent NTP Cluster synced to wall clock time

Resources

Stars

Watchers

Forks

Packages

No packages published