如何在HDInsight群集上查找不同节点的IP地址

时间:2018-09-18 08:33:06

标签: azure hdinsight azure-cli azureportal

我有一个运行Storm的HDInsight群集。该群集是由(不是我)设置的,没有DNS,因此只能使用URL中的IP地址进行访问。如何找到头节点的IP地址?我之前已经访问过它,但是IP地址是由某人给我的。将来我们将创建其他类似的集群,我想知道查找头节点IP地址的一般方法

理想情况下使用CLI或门户网站

编辑:HDInsight群集已经在VNET中。

这是我问题的更简洁版本。如何在不使用群集名称的情况下找到IP地址?

3 个答案:

答案 0 :(得分:0)

答案是,如果导航到“虚拟网络”概述,则可以找到IP地址。

答案 1 :(得分:0)

ssh进入群集的头节点并运行$curl ifconfig.me命令以获取头节点的IP地址。

您可以使用下面的bash命令获得群集中所有节点的完全限定域名(FQDN)(用群集名称替换$ CLUSTERNAME)。

curl -u admin -sS -G "https://$CLUSTERNAME.azurehdinsight.net/api/v1/clusters/$CLUSTERNAME/hosts" \
| jq '.items[].Hosts.host_name'

它可能会要求您安装“ jq”。上面的命令将返回以下节点列表

"hn0-mydemo.lle2qymtat0ehndwwaba2j1gih.dx.internal.cloudapp.net"
"hn1-mydemo.lle2qymtat0ehndwwaba2j1gih.dx.internal.cloudapp.net"
"wn0-mydemo.lle2qymtat0ehndwwaba2j1gih.dx.internal.cloudapp.net"
"wn1-mydemo.lle2qymtat0ehndwwaba2j1gih.dx.internal.cloudapp.net"
"wn2-mydemo.lle2qymtat0ehndwwaba2j1gih.dx.internal.cloudapp.net"
"wn3-mydemo.lle2qymtat0ehndwwaba2j1gih.dx.internal.cloudapp.net"
"zk0-mydemo.lle2qymtat0ehndwwaba2j1gih.dx.internal.cloudapp.net"
"zk2-mydemo.lle2qymtat0ehndwwaba2j1gih.dx.internal.cloudapp.net"
"zk3-mydemo.lle2qymtat0ehndwwaba2j1gih.dx.internal.cloudapp.net"

您可以使用以下命令从头节点SSH会话中SSH进入工作节点:

ssh sshuser@wn0-mydemo

一旦您SSH进入工作节点,请运行$curl ifconfig.me命令以获取工作节点的IP地址

通常,两个头节点都具有相同的IP地址,而所有4个工作节点都具有相同的IP地址。

答案 2 :(得分:-1)

Azure HDInsight群集uses Secure Shell (SSH) to securely connect to Hadoop on Azure HDInsight Storm

有关更多详细信息,请参阅“ Connect to HDInsight”。

注意:Azure HDInsight群集不允许将任何公共IP分配给它。

如果需要将IP分配给HDInsight群集,则必须在VNET中创建HDInsight。

有关更多详细信息,请参阅“ Extend Azure HDInsight using an Azure Virtual Network”。

相关问题