Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

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
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

avatar
Champion
@Laith I see that the docs states this but I recall the health test description for time synchronization references both ntp and chrony. My understanding is that either may be used and the requirement is just that time be synchronized. I have only used NTP to date but that is due to familiarity with it.

Anyway, to the OP, the only thing I can think of that may break is the CM health tests. If it only uses ntp commands like ntpq to validated that time is in synch then those test would report failures or unknown.

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."

avatar
Explorer

Thanks for the input, I've actually gone through the documentation, and was setting up the CentOS using the step suggested. I've just cleared this doubt. 

avatar
Rising Star

Hello DDreaner94,

 

Thanks for confirning that the docunmation works for you, and I agree with @mbigelowCDH itself isn't really doing the checking so much as relying on system time. The NTP check and Chrony check are doing by the Agent since there are some time sensitive components in the stack.

 

Please let us know if you have any other concers..

 

Have a nice day!

Laith 

avatar
Explorer

@Laith

The help was much appreciated.


Regards, 

DDreamer94

avatar
Expert Contributor

For a long time, I was using ntp only. In the last project, I had to use Chrony and since that, I will never back to ntp 🙂
I recommend Chrony.

avatar
Champion
@andrzej_jedrzej what specifically lead you to this? I know at times it can be difficult to troubleshoot issues in NTP and the various commands get confusing (i.e. ntpdate, nptq, etc.). Chrony and NTP look very similar in the install and configuration. What exactly is so different between them?

avatar

I have a problem in one host in my cluster. Clock offset issue. It gives an error like this :

May/2019 21:57:44 +0000] 26424 Metadata-Plugin navigator_plugin INFO Refreshing Metadata Plugin for keytrustee-KMS_KEYTRUSTEE with pipelines []
[21/May/2019 21:57:44 +0000] 26424 Audit-Plugin navigator_plugin_pipeline INFO Stopping Navigator Plugin Pipeline '' for keytrustee-KMS_KEYTRUSTEE (log dir: None)
[21/May/2019 21:57:44 +0000] 26424 Metadata-Plugin navigator_plugin_pipeline INFO Stopping Navigator Plugin Pipeline '' for keytrustee-KMS_KEYTRUSTEE (log dir: None)
[21/May/2019 21:58:35 +0000] 26424 Monitor-HostMonitor throttling_logger ERROR chronyc: chronyc sources: not synchronized to any server

All the other hosts works fine  but only this host doesn't work becaus of clock offset. 

1. it is pointing to the right NTP server and is sycnhronised too. chronyd is disabled like in all other hosts. ntpd is active and running.

Any help is appreciated on why cloudera agent is checking for chronyd on this one host?