Configure multiple NTP servers

Configure multiple NTP servers

Note

This feature is available starting from the MCP 2019.2.6 maintenance update. Before using the feature, follow the steps described in Apply maintenance updates.

MCP enables you to configure multiple Network Time Protocol (NTP) servers on new or existing MCP clusters to provide a more flexible and wide NTP support for clustered applications such as Ceph, Galera, and others.

For new MCP clusters, configure multiple NTP servers during the deployment model creation using the ntp_servers parameter passed to Cookiecutter in the following format:

server1.ntp.org,server2.ntp.org,server3.ntp.org

For details, see Networking deployment parameters in MCP Deployment Guide: Create a deployment metadata model.

For existing MCP clusters, configure multiple NTP servers by updating the NTP configuration for MAAS and all nodes of an MCP cluster.

To configure multiple NTP servers for MAAS:

  1. Log in to the Salt Master node.

  2. Open the cluster level of your deployment model.

  3. In infra/maas.yml, update the MAAS pillars using the example below:

    parameters:
      maas:
        region:
          ...
          ntp:
            server1:
              enabled: True
              host: ntp.example1.org
            server2:
              enabled: True
              host: ntp.example2.o
    
  4. Update the MAAS configuration:

    salt-call saltutil.refresh_pillar
    salt-call state.apply maas.region
    

To configure multiple NTP servers for all nodes of an MCP cluster:

  1. Log in to the Salt Master node.

  2. Open the cluster level of your deployment model.

  3. In infra/init.yml, update the MAAS pillars using the example below:

    parameters:
      ntp:
        client:
        enabled: true
        stratum:
          primary:
            server: primary.ntp.org
          secondary: # if exist
            server: secondary.ntp.org
          srv_3: # if exist
            server: srv_3.ntp.org
    
  4. Update the NTP configuration:

    salt '*' saltutil.refresh_pillar
    salt '*' state.apply ntp.client