Child pages
  • Setting Up NTP for ClustrixDB on CentOS

This is documentation for a previous version of ClustrixDB. Documentation for the latest version can be found here

Skip to end of metadata
Go to start of metadata

As of Clustrix v7.0, the installation process will include installation and basic configuration of NTP. To ensure that NTP is up and running, please follow the steps outlined in Step #10 below.

 

ClustrixDB needs system clocks to be in sync for a number of reasons. The logs on each node use each system's clock to record events, so if all the clocks are in sync, it is much easier to diagnose issues and create timelines. Synchronized Clocks are also required for software upgrades and the system will generate alerts if the clocks skew too much between nodes in a cluster.

To ensure that clocks are in sync between nodes, an ntp client should be configured on each node of the cluster. This example shows output from a single node. When running clx commands you will see result output from each node. It is important to verify that each node successfully returns the expected output.

Prerequisites

This setup procedure assumes that the clx tool is able to properly authenticate between nodes. If this is not functioning, you must get this working before continuing. You can test this by running the following command: 

/opt/clustrix/bin/clx cmd 'date'

And verify that each node returns a value.

For more information on setting up internode communication see: Internode Administrative Connectivity via Ethernet.

Setting Up NTP on CentOS

SSH to any of the nodes as root and run the following commands:

  1. Assuming ntp & ntpdate are not already installed:

    /opt/clustrix/bin/clx cmd 'yum -y install ntp ntpdate'
  2. If the default ntp servers are not accessible, add one(s) that are.

    edit /etc/ntp.conf to add the line: server <your_ntp_server_hostname_or_ip> 

    Example: server pool.ntp.org 
     

  3. If you modified /etc/ntp.conf in step 2, copy this file to all of the nodes in your cluster:

    /opt/clustrix/bin/clx push /etc/ntp.conf /etc/ntp.conf
  4. Run the following to synchronize clocks:

    /opt/clustrix/bin/clx cmd 'ntpd -qd'

    Result:

    ------------------------------------------------------------------------------
    {nid: 1, hostname: <hostname>, ip: 1.2.3.4}
    ntpd [email protected] Sat Nov 23 18:21:48 UTC 2013 (1)
     5 Mar 11:33:09 ntpd[2344]: proto: precision = 0.133 usec
     5 Mar 11:33:09 ntpd[2344]: 0.0.0.0 c01d 0d kern kernel time sync enabled
    event at 0 0.0.0.0 c01d 0d kern kernel time sync enabled
    Finished Parsing!!
    ...
    clock_update: at 7 sample 7 associd 11991
     5 Mar 11:33:16 ntpd[2344]: ntpd: time slew +0.009775 s
    ntpd: time slew +0.009775s
  5. Set ntp to start as a regular service:

    /opt/clustrix/bin/clx cmd 'chkconfig ntpd on'
  6. Confirm it’s set correctly on all nodes:

    /opt/clustrix/bin/clx cmd 'chkconfig --list ntpd'

    Result:

    ------------------------------------------------------------------------------
    {nid: 1, hostname: <hostname>, ip: 1.2.3.4}
    ntpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
  7. Start the ntp service:

    /opt/clustrix/bin/clx cmd '/etc/init.d/ntpd start'

    Result:

    ------------------------------------------------------------------------------
    {nid: 1, hostname: <hostname>, ip: 1.2.3.4}
    Starting ntpd: [ OK ]
  8. Confirm that the service is running with: 

    /opt/clustrix/bin/clx cmd 'ps aux | grep ntp'

    Look for:

    ntpd -u ntp:ntp -p /var/run/ntpd.pid -g
  9. Confirm date/time is in sync with:

    /opt/clustrix/bin/clx cmd 'date'

    Result:

    ------------------------------------------------------------------------------
    {nid: 1, hostname: <hostname>, ip: 1.2.3.4}Mon Mar 3 16:35:27 PST 2014
  10. Confirm ntp is running properly with:

    /opt/clustrix/bin/clx cmd 'ntpstat'

    Result:

    ------------------------------------------------------------------------------
    {nid: 1, hostname: nickwhatever.colo.sproutsys.com, ip: 10.2.3.142}
    synchronised to NTP server (204.2.134.163) at stratum 4
     time correct to within 1005 ms
     polling server every 64 s

    Example of ntp not running properly:

    ------------------------------------------------------------------------------
    {nid: 1, hostname: nickwhatever.colo.sproutsys.com, ip: 10.2.3.142}
    Unable to talk to NTP daemon. Is it running?

 

  • No labels