使用 Ambari 服务器向导设置 Ambari 主机时遇到问题

使用 Ambari 服务器向导设置 Ambari 主机时遇到问题

我已经安装了 Ambari 服务器,并使用向导设置代理。它无法识别

==========================
Running setup agent script...
==========================

Command start time 2019-08-19 22:35:34
Host registration aborted. Ambari Agent host cannot reach Ambari Server 'localhost:8080'. Please check the network connectivity between the Ambari Agent host and the Ambari Server

Connection to ingest-1.testserver.com closed.
SSH command execution finished
host=ingest-1.testserver.com, exitcode=1
Command end time 2019-08-19 22:35:34

ERROR: Bootstrap of host ingest-1.testserver.com fails because previous action finished with non-zero exit code (1)
ERROR MESSAGE: Connection to ingest-1.testserver.com closed.

STDOUT: Host registration aborted. Ambari Agent host cannot reach Ambari Server 'localhost:8080'. Please check the network connectivity between the Ambari Agent host and the Ambari Server

Connection to ingest-1.testserver.com closed.

Ambari 服务器位于 master.testserver.com。我在/etc/hosts/etc/hostname文件中设置了 FQDN,运行时可以看到正确的 FQDN hostname -f

这些确切的服务器名称不是实际的子域或域,但正确表示了情况。出于某种原因,代理尝试以 localhost 而不是 Ambari 服务器的 FQDN 身份返回服务器。

答案1

我知道这是网络问题,但我花了点时间才弄清楚问题到底是什么。这与我们默认的服务器初始化脚本的工作方式有关。

在master.testserver.com上,该/etc/hosts文件看起来像这样。

127.0.0.1 localhost
127.0.0.1 master.testserver.com
198.85.79.75 master.testserver.com
45.65.103.45 ingest-1.testserver.com

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

在 ingest-1.testserver.com 上,该/etc/hosts文件看起来像这样。

127.0.0.1 localhost
127.0.0.1 ingest-1.testserver.com
45.65.103.45 ingest-1.testserver.com
198.85.79.75 master.testserver.com

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

在这两行中,除了两行公共 IP 地址外,其他所有行均由我们的服务器初始化脚本设置。两行公共 IP 地址由我编写的脚本添加,用于引导它们以准备使用 Ambari。在两台服务器上,列出 127.0.0.1 和机器的 FQDN 的两行是问题所在。删除它们并重新启动主服务器上的 ambari-server 服务后,问题解决了。

相关内容