通过 Ambari 安装 DataNode

Install DataNode by Ambari

我有

OS Red Hat Enterprise Linux Server release 7.4 (Maipo)
Ambari Version 2.5.1.0
HDP 2.6

组件部署完成后2个数据节点无法启动。 尝试启动返回错误:

  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 303, in _call
    raise ExecutionFailed(err_msg, code, out, err)
resource_management.core.exceptions.ExecutionFailed: Execution of 'ambari-sudo.sh su hdfs -l -s /bin/bash -c 'ulimit -c unlimited ;  /usr/hdp/current/hadoop-client/sbin/hadoop-daemon.sh --config /usr/hdp/current/hadoop-client/conf start datanode'' returned 127. -bash: /usr/hdp/current/hadoop-client/sbin/hadoop-daemon.sh: No such file or directory

我尝试删除组件并通过 Ambari 进行新安装。

安装完成无误

2018-02-27 20:47:31,550 - Execute['ambari-sudo.sh /usr/bin/hdp-select set all `ambari-python-wrap /usr/bin/hdp-select versions | grep ^2.6 | tail -1`'] {'only_if': 'ls -d /usr/hdp/2.6*'}
2018-02-27 20:47:31,554 - Skipping Execute['ambari-sudo.sh /usr/bin/hdp-select set all `ambari-python-wrap /usr/bin/hdp-select versions | grep ^2.6 | tail -1`'] due to only_if
2018-02-27 20:47:31,554 - FS Type: 
2018-02-27 20:47:31,554 - XmlConfig['core-site.xml'] {'group': 'hadoop', 'conf_dir': '/usr/hdp/current/hadoop-client/conf', 'configuration_attributes': {u'final': {u'fs.defaultFS': u'true'}}, 'owner': 'hdfs', 'only_if': 'ls /usr/hdp/current/hadoop-client/conf', 'configurations': ...}
2018-02-27 20:47:31,568 - Generating config: /usr/hdp/current/hadoop-client/conf/core-site.xml
2018-02-27 20:47:31,569 - File['/usr/hdp/current/hadoop-client/conf/core-site.xml'] {'owner': 'hdfs', 'content': InlineTemplate(...), 'group': 'hadoop', 'mode': None, 'encoding': 'UTF-8'}
2018-02-27 20:47:31,583 - Could not load 'version' from /var/lib/ambari-agent/data/structured-out-3374.json

Command completed successfully!

但新开始显示更多错误。 我检查了文件夹 /usr/hdp/current/hadoop-client/ 在文件夹中新文件例如 /sbin/hadoop-daemon.sh 没有出现。

如何重新通过Ambari部署组件DataNode?

我猜这个问题是由 /usr/hdp 上的错误符号链接引起的。您甚至可以尝试手动修复它们,结构非常简单。在普通堆栈部署之后,这个问题听起来并不常见。

您 运行 Ambari 是 non-root/custom 用户吗?也许 Ambari 没有足够的权限?参见 https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.0.0/bk_ambari-security/content/how_to_configure_ambari_server_for_non-root.html

Ambari 版本 2.5.1.0 相当过时,因此更新 Ambari 并查看它是否有帮助是有意义的。 另外,如果你想清除所有内容,请参阅 https://github.com/hortonworks/HDP-Public-Utilities/blob/master/Installation/cleanup_script.sh

另外,在这里问 Ambari-related 个问题可能更有效率 https://community.hortonworks.com/