2017-04-11 44 views
0

我已經創建了template1,它將部署HDI羣集和template2,它將單獨部署Azure VM。如何使用ARM模板獲取HDI羣集的私有IP

現在我想從集羣中獲取頭節點專用IP,並將其傳遞給Azure VM模板以使用ARM模板進行處理。

我該怎麼做?

回答

1

考慮到這是你從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部署上使用dependOn,並參考與VMextension的輸入相同的內容。

+0

1.我將xxx.azurehdinsight.net作爲輸出。但我想獲得內部IP。有沒有辦法得到它。 2.通過獲取IP後創建新部署意味着什麼? 3.我可以使用VM的鏈接模板嗎? 4.爲了測試這個,我需要創建需要20分鐘的集羣,有沒有更簡單的方法來測試這需要更少的時間? – karan

+0

1.這就是你得到的。 2.創建新的部署意味着創建新的部署。 3.你可以,鏈接模板並不重要,或者只是將其部署在同一個模板中,或者只是創建另一個部署。 4. No. – 4c74356b41

+0

3.如何在虛擬機模板中傳遞或使用羣集IP? – karan

相關問題