Support Questions

Find answers, ask questions, and share your expertise

Should Cloudera NTP use Chrony or NTPD?

avatar
Explorer

As the subject line goes, I'm confused by whether if Chrony or NTPD is commonly used for installing cloudera.

 

 

2 ACCEPTED SOLUTIONS

avatar
Rising Star

Hello DDreamer94!

 

CDH requires that you configure the NTP service on each machine in your cluster. For more information, please take a look into:

https://www.cloudera.com/documentation/enterprise/latest/topics/install_cdh_enable_ntp.html

 

Thanks,

Laith

View solution in original post

avatar
Champion

NTP or Chrony should work.

 

From the Clock Offset Host Health check (CM 5.8.2).

 

"This is a host health test that checks if the host's system clock appears to be out-of-sync with its NTP server(s). The test uses the 'ntpdc -np' (if ntpd is running) or 'chronyc sources' (if chronyd is running) command to check that the host is synchronized to an NTP peer and that the absolute value of the host's clock offset from that peer is not too large. If the command fails, NTP is not synchronized to a server, or the host's NTP daemon is not running or cannot be contacted, the test will return "Bad" health.

The 'ntpdc -np' or 'chronyc sources' output contains a row for each of the host's NTP servers. The row starting with a '*' (if ntpdc) or '^*' (if chronyc) contains the peer to which the host is currently synchronized. No row starting with a '*' or '^*' indicates that the host is not currently synchronized. Communication errors and too large an offset between the peer and the host time are examples of conditions that can lead to a host being unsynchronized.

Make sure that UDP port 123 is open in any firewall that is in use. Check the system log for ntpd or chronyd messages related to configuration errors. If running ntpd, use 'ntpdc -c iostat' to verify that packets are sent and recieved between the different peers. More information about the conditions of each peer can be found by running the command 'ntpq -c as'. The output of this command includes the association ID that can be used in combination with 'ntpq -c "rv "' to get more information about the status of each such peer. The command 'ntpq -c pe' can also be used to return a summary of all peers and the reason why they are not in use. If running chronyd, use 'chronyc activity' to check how many NTP sources are online/offline. More information about the conditions of each peer can be found by running the command 'chronyc sourcestats'. To check chrony tracking, issue the command 'chronyc tracking'.

If NTP is not in use on the host, this check should be disabled for the host using the configuration options shown below. Cloudera recommends using NTP for time synchronization of Hadoop clusters.

A failure of this health test can indicate a problem with the host's NTP service or configuration."

View solution in original post

13 REPLIES 13

avatar
Expert Contributor

Did you try to disable ntpd and enable chrony and check what will happen?

avatar

tried it , same error. Opened up a new thread. Please reply there. Will tag you

avatar
Not able to tag you in another thread. let me know if anything else need to be tried.

avatar
Master Guru

@BiggieSmalls ,

 

It would probably be a good idea to start a new thread for this new issue if more discussion is required.

 

To your question, though, the Cloudera Manager agent will run the following command to determine if chronyd is running:

  # pidof chronyd

 

If the result code is "0" that means there was a chronyd process running, so the agent will attempt to check the offset.

This is done by running:

 

  # chronyc -n sources

 

The agent then iterates over the output, line by line.  If a line starts with "*" then it will attempt to derive the offset by looking at that line.

The error you get "not synchronized to any server" is returned of NO lines started with "*"

 

If you did not intend to use chronyd, then you can shut it off on the problematic host and then make sure ntpd is working by using "ntpq -np" and making sure one of the lines starts with a "*" to indicate the daemon is synchronized to that server.

 

Ben