Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure 如何使用ARM模板获取HDI集群的私有IP_Azure_Azure Hdinsight_Arm Template - Fatal编程技术网

Azure 如何使用ARM模板获取HDI集群的私有IP

Azure 如何使用ARM模板获取HDI集群的私有IP,azure,azure-hdinsight,arm-template,Azure,Azure Hdinsight,Arm Template,我已经创建了template1,它将部署HDI集群,template2将分别部署Azure VM 现在我想从集群中获取头节点私有IP,并将其传递给Azure VM模板,以便使用ARM模板进行处理 我该怎么做?考虑到这是您从HDcluster获得的对象: { "id": "xxx", "name": "xxx", "type": "Microsoft.HDInsight/clusters", "location": "East US", "etag": "x

我已经创建了template1,它将部署HDI集群,template2将分别部署Azure VM

现在我想从集群中获取头节点私有IP,并将其传递给Azure VM模板,以便使用ARM模板进行处理


我该怎么做?

考虑到这是您从HDcluster获得的对象:

{
    "id": "xxx",
    "name": "xxx",
    "type": "Microsoft.HDInsight/clusters",
    "location": "East US",
    "etag": "xxx",
    "tags": null,
    "properties": {
        "clusterVersion": "3.5.1000.0",
        "osType": "Linux",
        "clusterDefinition": {
            "blueprint": "https://blueprints.azurehdinsight.net/spark-3.5.1000.0.9865375.json",
            "kind": "SPARK",
            "componentVersion": {
                "Spark": "1.6"
            }
        },
        "computeProfile": {
            "roles": [
                {
                    "name": "headnode",
                    "targetInstanceCount": 2,
                    "hardwareProfile": {
                        "vmSize": "ExtraLarge"
                    },
                    "osProfile": {
                        "linuxOperatingSystemProfile": {
                            "username": "sshuser"
                        }
                    }
                },
                {
                    "name": "workernode",
                    "targetInstanceCount": 1,
                    "hardwareProfile": {
                        "vmSize": "Large"
                    },
                    "osProfile": {
                        "linuxOperatingSystemProfile": {
                            "username": "sshuser"
                        }
                    }
                },
                {
                    "name": "zookeepernode",
                    "targetInstanceCount": 3,
                    "hardwareProfile": {
                        "vmSize": "Medium"
                    },
                    "osProfile": {
                        "linuxOperatingSystemProfile": {
                            "username": "sshuser"
                        }
                    }
                }
            ]
        },
        "provisioningState": "Succeeded",
        "clusterState": "Running",
        "createdDate": "2017-04-11T09:07:44.68",
        "quotaInfo": {
            "coresUsed": 20
        },
        "connectivityEndpoints": [
            {
                "name": "SSH",
                "protocol": "TCP",
                "location": "xxx.azurehdinsight.net",
                "port": 22
            },
            {
                "name": "HTTPS",
                "protocol": "TCP",
                "location": "xxx.azurehdinsight.net",
                "port": 443
            }
        ],
        "tier": "standard"
    }
}
我猜这是你能得到的最好的输出,所以你可以使用如下方法:

"outputs": {
    "test": {
        "type": "Object",
        "value": "[reference(parameters('clusterName'),'2015-03-01-preview').connectivityEndpoints[0].location]"
    }
}
这将获得xxx.azurehdinsight.net的输出


您可以使用这些数据创建一个新的部署,或者(正如我所说)将RHEL VM添加到同一模板中,使其
依赖于HDCluster部署,并引用相同的内容作为VMextension的输入。

1。我得到xxx.azurehdinsight.net作为输出。但我想获得内部IP。有办法得到它吗。2.获得IP后创建新部署是什么意思?3.我可以为VM使用链接模板吗?4.为了测试这一点,我需要创建一个需要20分钟的集群,有没有更简单的方法来测试这个需要更少时间的集群。这就是你得到的。2.创建新部署意味着创建新部署。3.您可以,这与链接模板无关,也与在同一模板中部署或创建另一个部署无关。4.第三。我们如何在VM模板中传递或使用集群IP?答案是,使用相同的引用作为scrip扩展的输入,我将使用链接模板和json格式的模板、参数文件。这会在VM模板中使用“[reference('linkedTemplate').outputs.test]”吗?