首页 > 解决方案 > ambari-agent 无法再通过 http:// 联系服务器:8440?

问题描述

我们目前正在运行 Hortonworks 2.6.5.0:

$ hadoop version
Hadoop 2.7.3.2.6.5.0-292
Subversion git@github.com:hortonworks/hadoop.git -r 3091053c59a62c82d82c9f778c48bde5ef0a89a1
Compiled by jenkins on 2018-05-11T07:53Z
Compiled with protoc 2.5.0
From source with checksum abed71da5bc89062f6f6711179f2058
This command was run using /usr/hdp/2.6.5.0-292/hadoop/hadoop-common-2.7.3.2.6.5.0-292.jar

操作系统是 CentOS 7:

$ cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)

ambari-agent我们最近开始在的日志文件中注意到这些问题:

$ grep -i "error|warn" /var/log/ambari-agent/*
/var/log/ambari-agent/ambari-agent.log:WARNING 2018-07-30 14:03:50,982 NetUtil.py:124 - Server at https://hbase26-2.mydom.com:8440 is not reachable, sleeping for 10 seconds...
/var/log/ambari-agent/ambari-agent.log:ERROR 2018-07-30 14:04:00,986 NetUtil.py:96 - EOF occurred in violation of protocol (_ssl.c:579)
/var/log/ambari-agent/ambari-agent.log:ERROR 2018-07-30 14:04:00,990 NetUtil.py:97 - SSLError: Failed to connect. Please check openssl library versions.
/var/log/ambari-agent/ambari-agent.log:WARNING 2018-07-30 14:04:00,990 NetUtil.py:124 - Server at https://hbase26-2.aa.mydom.com:8440 is not reachable, sleeping for 10 seconds...
/var/log/ambari-agent/ambari-agent.log:ERROR 2018-07-30 14:04:10,993 NetUtil.py:96 - EOF occurred in violation of protocol (_ssl.c:579)
/var/log/ambari-agent/ambari-agent.log:ERROR 2018-07-30 14:04:10,994 NetUtil.py:97 - SSLError: Failed to connect. Please check openssl library versions.
/var/log/ambari-agent/ambari-agent.log:WARNING 2018-07-30 14:04:10,994 NetUtil.py:124 - Server at https://hbase26-2.aa.mydom.com:8440 is not reachable, sleeping for 10 seconds...
/var/log/ambari-agent/ambari-agent.log:ERROR 2018-07-30 14:04:20,996 NetUtil.py:96 - EOF occurred in violation of protocol (_ssl.c:579)
/var/log/ambari-agent/ambari-agent.log:ERROR 2018-07-30 14:04:20,997 NetUtil.py:97 - SSLError: Failed to connect. Please check openssl library versions.

当这些开始发生时,我们无法再通过 Ambari 管理 Hadoop 集群的任何方面。所有服务都显示黄色小问号,并说“心跳丢失”。

多次重启将不允许我们恢复 Ambari,并最终重新控制我们的集群。

标签: hadoophortonworks-data-platformambari

解决方案


这个问题原来是由于服务器在尝试连接到端口 8440 上的 CA 服务时无法处理 TLSv1.1 证书。

我们注意到该服务实际上正在运行:

$ netstat -tapn|grep 8440
tcp        0      0 0.0.0.0:8440            0.0.0.0:*               LISTEN      1203/java

但是curl这样做会失败,除非我们通过--insecure开关禁用 TLS 检查。这是我们第一个发现它似乎与 TLS 相关的线索。

进一步的调查使我们找到了看起来不错的 NetUtil.py(Ambari 的一部分)。其他线索包括:

$ cat /etc/ambari-agent/conf/ambari-agent.ini
...
[security]
ssl_verify_cert = 0
...

和这个:

$ grep -E '\[https|verify' /etc/python/cert-verification.cfg
[https]
#verify=platform_default
verify=disable

这些都没有奏效。最终起作用的是,强制ambari-agent使用 TLSv1.2 与 TLS1.1:

$ grep -E "\[security|force" /etc/ambari-agent/conf/ambari-agent.ini
[security]
force_https_protocol=PROTOCOL_TLSv1_2

然后重启,ambari-agent restart.

我能够使用散布在互联网上的一缕缕提示将这一切拼凑起来。我把它放在这里是希望它能帮助任何其他在他们的 Hadoop/Hortonworks 集群上发生这种情况的可怜人。

参考

为什么会这样?

进一步调试/挖掘我发现这个线程的标题是:禁用 TLSv1 & TLS1.1 - 启用 TLSv1.2。现在显然必须将 Ambari 代理配置为使用 TLSv1.2。


推荐阅读