CDH安装NTP时钟不同步引发agent监控错误

点击数:47

[26/Apr/2020 13:15:07 +0000] 23305 DnsResolutionMonitor throttling_logger INFO     (59 skipped) DnsTest not running. Java not located.
[26/Apr/2020 13:24:42 +0000] 23305 MainThread heartbeat_tracker INFO     HB stats (seconds): num:40 LIFE_MIN:0.02 min:0.01 mean:0.06 max:0.22 LIFE_MAX:0.14
[26/Apr/2020 13:26:34 +0000] 23305 Monitor-HostMonitor throttling_logger ERROR    Timeout with args [\'chronyc\', \'sources\']
None
[26/Apr/2020 13:26:34 +0000] 23305 Monitor-HostMonitor throttling_logger ERROR    Failed to collect NTP metrics
Traceback (most recent call last):
  File \"/opt/cm-5.14.3/lib64/cmf/agent/build/env/lib/python2.7/site-packages/cmf-5.14.3-py2.7.egg/cmf/monitor/host/ntp_monitor.py\", line 45, in collect
    self.collect_chronyd()
  File \"/opt/cm-5.14.3/lib64/cmf/agent/build/env/lib/python2.7/site-packages/cmf-5.14.3-py2.7.egg/cmf/monitor/host/ntp_monitor.py\", line 55, in collect_chronyd
    result, stdout, stderr = self._subprocess_with_timeout(args, self._timeout)
  File \"/opt/cm-5.14.3/lib64/cmf/agent/build/env/lib/python2.7/site-packages/cmf-5.14.3-py2.7.egg/cmf/monitor/host/ntp_monitor.py\", line 38, in _subprocess_with_timeout
    return subprocess_with_timeout(args, timeout)
  File \"/opt/cm-5.14.3/lib64/cmf/agent/build/env/lib/python2.7/site-packages/cmf-5.14.3-py2.7.egg/cmf/subprocess_timeout.py\", line 94, in subprocess_with_timeout
    raise Exception(\"timeout with args %s\" % args)
Exception: timeout with args [\'chronyc\', \'sources\']

解决方法:
配置ntp服务。假如 cdh1 机器为ntp服务主节点。

  • 每个每个节点:
yum install ntp -y

service ntpd start
chkconfig ntpd on
  • ntp服务主节点,此处为cdh1
# ntpstat
synchronised to NTP server (192.168.48.4) at stratum 4
   time correct to within 128 ms
   polling server every 64 s
  • 其他节点
# vim /etc/ntp.conf

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server chd1 prefer
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
ntpdate -u cdh1

发表评论

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据