我有一个运行Storm的HDInsight集群。此群集是在没有DNS的情况下设置的(不是我),因此只能使用URL中的IP地址进行访问。如何查找头节点的IP地址?我以前访问过它,但IP地址是由某人给我的。将来我们将创建这样的其他集群,我想知道查找头节点IP地址的一般方法
理想情况下使用CLI或门户
编辑:HDInsight群集已经在VNET中。
这是我的问题更简洁的版本。如何在不使用群集名称的情况下找到IP地址?
答案是,如果导航到虚拟网络资源概述,则可以找到IP地址。
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"
您可以使用以下命令从headnode SSH会话中SSH到您的工作节点
ssh sshuser@wn0-mydemo
一旦SSH进入工作节点,就运行$curl ifconfig.me
命令获取工作节点的IP地址
通常,两个头节点具有相同的IP地址,并且所有4个工作节点具有相同的IP地址。
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”。