Support Questions
Find answers, ask questions, and share your expertise

installing agents with cloudera manager fail to detect ntp source

New Contributor

I have trouble installing agents with Cloudera manager. It fail to detect the ntp source.  I think you reach a point where you need to upgrade the python code to also try sntp and not just ntpq or chrony. I am at the step in the installation where it try to install agents. I got the error

 

[21/Apr/2020 15:42:07 +0000] 17124 Monitor-HostMonitor throttling_logger ERROR Failed to collect NTP metrics
>>Traceback (most recent call last):
>> File "/opt/cloudera/cm-agent/lib/python2.7/site-packages/cmf/monitor/host/ntp_monitor.py", line 49, in collect
...

 

on ntp_monitor.py. this is the code

 

if self._is_chronyd_running:
self.collect_chronyd()
return
else:
self.collect_ntpd()
return

 

where it failed to detect chrony and then step to use ntp instead. to detect chrony you attempt to run

 

chronyc -n sources

 

This command  is working well on my machine when I run it on a command line.it gives me

 

210 Number of sources = 8
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^- 91.189.89.198 2 6 377 10 -3518us[-3518us] +/- 80ms
^- 91.189.94.4 2 6 377 9 -3386us[-3386us] +/- 74ms
^- 91.189.91.157 2 6 377 12 -4848us[-4848us] +/- 96ms
^- 91.189.89.199 2 6 377 9 -2785us[-2785us] +/- 71ms
^+ 198.27.76.102 2 6 377 12 +518us[ +518us] +/- 36ms
^+ 144.217.75.110 2 6 377 14 -657us[ +264us] +/- 39ms
^- 206.75.147.25 2 6 377 13 +1048us[+1048us] +/- 89ms
^* 149.56.121.16 2 6 377 13 +532us[+1456us] +/- 15ms

 

In the code If the result is not 0 you then log something with 

THROTTLED_LOG.info("chronyc return=%d\nstdout=%s\nstderr=%s",
result, stdout, stderr)

that I do not see in any log

 

What you test in the second part collect_ntpd() is the command ntpq So I tried installing ntp with

 

apt-get install ntp

 

but what it install instead is sntp. The service running is still call ntp but the ntp command is not installed. There is no ntpq installed  with that one.

 

I tried to install ntpsec which installed the ntpq command and stop the chrony services. Now when I try the ntpq command it gives

 

remote refid st t when poll reach delay offset jitter
=======================================================================================================
0.ubuntu.pool.ntp.org .POOL. 16 p - 256 0 0.0000 0.0000 0.0001
1.ubuntu.pool.ntp.org .POOL. 16 p - 256 0 0.0000 0.0000 0.0001
2.ubuntu.pool.ntp.org .POOL. 16 p - 256 0 0.0000 0.0000 0.0001
3.ubuntu.pool.ntp.org .POOL. 16 p - 64 0 0.0000 0.0000 0.0001
91.189.94.4 17.253.34.125 2 u 18 64 1 108.6034 6.1139 0.0000
+192.99.2.8 213.251.128.249 2 u 12 64 1 23.4581 0.5081 2.9410
+162.159.200.1 10.11.8.211 3 u 12 64 1 34.4872 -1.8376 3.7264
-149.56.47.60 206.108.0.132 2 u 12 64 1 22.9684 1.0131 2.9339
-209.115.181.107 158.69.226.90 3 u 12 64 1 63.7419 1.1466 3.2377
+209.115.181.102 206.108.0.131 2 u 11 64 1 60.9719 -0.5631 2.5202
+149.56.121.17 213.251.128.249 2 u 11 64 1 19.9749 -1.0586 2.3062
+162.159.200.123 10.11.8.211 3 u 11 64 1 28.4805 -1.8700 1.3113
-205.206.70.2 206.108.0.131 2 u 11 64 1 54.7109 -3.6217 2.6883
-192.99.68.38 172.41.123.180 3 u 10 64 1 23.1147 0.9181 2.5066
#199.182.221.110 214.176.184.39 2 u 10 64 1 78.9152 0.7306 2.2603
*174.94.155.224 .PPS. 1 u 10 64 1 26.4634 0.5505 2.4652
#159.203.8.72 132.236.56.250 3 u 10 64 1 21.3928 -6.7555 3.4208
2607:5300:120:81a::1 .INIT. 16 u - 64 0 0.0000 0.0000 0.0001
2602:fde5:2a::12 .INIT. 16 u - 64 0 0.0000 0.0000 0.0001
2606:4700:f1::1 .INIT. 16 u - 64 0 0.0000 0.0000 0.0001
2001:470:b2de::1 .INIT. 16 u - 64 0 0.0000 0.0000 0.0001

 

When I ran the cloudera manager it gives me instead an error

 

[21/Apr/2020 16:43:42 +0000] 25731 Monitor-HostMonitor throttling_logger INFO ntpq return=-6
>>stdout=
>>stderr=Fatal Python error: Py_Initialize: Unable to get the locale encoding
>>ModuleNotFoundError: No module named 'encodings'

 

 

Does somebody has somethign to propose me to get out of that if statement without modifying the python file.

 

This is a small part of the problem I got with the installation. As usual with Linux I started something that should be quick and I am a the end of the day trying workaround that lead me to some more failure.

1 REPLY 1

New Contributor

I ran it another time after reinstalling chrony and putting the ip address instead of the computer name and I found a result

 

Monitor-HostMonitor throttling_logger INFO chronyc return=1
>>stdout=506 Cannot talk to daemon

 

while running it manually it is still working.