Centos 7安装 ambari-agent报错NetUtil.py-[SSL: CERTIFICATE_VERIFY_FAILED]

Centos 7安装 ambari通过Ambari部署系统时,ambari-agent注册失败,在/var/log/ambari-agent的log中可以看到日志显示:

ERROR 2018-03-08 15:02:25,223 NetUtil.py:88 - [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)
ERROR 2018-03-08 15:02:25,223 NetUtil.py:89 - SSLError: Failed to connect. Please check openssl library versions.

从字面上看为openssl版本的问题,实际是因为python版本的问题。
在python 2.7.5及以上版本时,增加了certificate verification,正是因为这个特性导致ambari-agent无法连接server。

解决方法:
修改/etc/python/cert-verification.cfg配置文件:
# cat /etc/python/cert-verification.cfg

# Possible values are:
# 'enable' to ensure HTTPS certificate verification is enabled by default
# 'disable' to ensure HTTPS certificate verification is disabled by default
# 'platform_default' to delegate the decision to the redistributor providing this particular Python version

# For more info refer to https://www.python.org/dev/peps/pep-0493/
[https]
verify=platform_default ###(这是默认配置)

cert-verification.cfg文件
修改为verify=disable,然后重启ambari agent,就可以正常注册。

你可能感兴趣的:(HDP和CDH)