如何以编程方式检索名称节点主机名?

How to programmatically retrieve the name node hostname?

IBM Analytics Engine docs 具有以下获取名称节点主机名的说明:

Go to Manage Cluster in IBM® Cloud and click the nodes tab to get the name node host name. It's the host name of the management-slave1 node type.

如何以编程方式检索名称节点主机名?我可以通过 API 检索它,或者我可以通过 运行 通过 ssh 命令获取它。如果做不到这一点,我可以从 vcap 服务上的主机名之一派生它吗?

也许应该在 vcap 信息中向用户提供此信息?

最后,我用ambari解决了这个问题。此处捕获了对我有用的解决方案: