ambari-agent 主机心跳丢失报错——2018年(含)之前整理二

372 阅读2分钟

本文已参与「新人创作礼」活动,一起开启掘金创作之路。

ambari-agent 主机心跳丢失报错

背景

amabri 安装后,ambari-agent包心跳丢失告警

问题

查看日志

ERROR 2017-11-29 23:59:35,626 NetUtil.py:84 - [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)\


ERROR 2017-11-29 23:59:35,626 NetUtil.py:85 - SSLError: Failed to connect. Please check openssl library versions.

Refer to: <https://bugzilla.redhat.com/show_bug.cgi?id=1022468> for more de tails.

image.png

解决

注:ambari-agent 启动失败查看日志错误:certificate verify failed

Failed to connect. Pleasecheck openssl library versions

在openssl版本一致的情况python-2.7.5可能会出现证书验证失败下禁用证书就可以了执行如命令:

sed -i 's/verify=platform_default/verify=disable/'/etc/python/cert-verification.cfg

这种心跳丢失不是很常见 所以特意说明一下

其他两种情况

第一种

一种是主机ip 改变 没有修改hosts文件 这种直接修改/etc/hosts/文件,并在集群中同步就可

第二种

还有一种是 日期没有同步 用ntp同步一下就好 这个网上很好找

操作系统时区设置

操作系统时区统一设置为 (Asia /Shanghai) , 时间采用NTP 同步。让namenode其中一台机器充当时间服务器的角色,其他所有的机器和它进行同步,保证集群时间的一致性。 设置命令:(cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime)

操作系统时钟设置

检查是否安装NTP服务:(rpm –qa|grep ntp)

安装NTP服务:(yum install ntp)

集群中所有节点主机的时间必须设置同步才能访问Ambari的Web UI界面。

检测时间同步是否开机自启

集群内所有节点都要检查是否设置时钟同步开机自启。

systemctl is-enabled ntpd(是否开机自启)

systemctl enable ntpd(设置开机自启)

开启时间同步

配置ntp server:

(vi /etc/ntp.conf)

# Hosts on local network are less restricted.

restrict 10.20.52.0 mask 255.255.255.0 nomodify notrap  # 允许内网其他机器同步时间

# Please consider joining the pool (http://www.pool.ntp.org/join.html).

#server 0.centos.pool.ntp.org iburst    #注释掉原时钟服务器()

server  127.127.1.0 # local clock   

fudge 127.127.1.0 stratum 10

修改完后如下图所示:

image.png 重启ntp服务,并设置开机自启动

systemctl restart ntpd.service

配置ntp client

# (vi /etc/ntp.conf)注释原时钟服务器,增加2行

#Hosts on local network are less restricted

Restrict 10.20.52.247 nomodify notrap noquery

server 10.20.52.247       #ntp server inner net

#server 1.centos.pool.ntp.org

#server 2.centos.pool.ntp.org   

如下图所示:

image.png

重启ntp服务

systemctl restart ntpd.service

systemctl enable ntpd(设置开机自启)

验证ntp时钟同步

5分钟后验证,client执行指令如下:

验证配置同步源ntp server是否生效:

ntpq -p

image.png

ntpstat

synchronised to NTP server (172.16.1.19) at stratum 7

   time correct to within 34 ms

   polling server every 1024 s NTP server状态正常。