1
votes

I have created HDI cluster using ARM template. Now HDI cluster is running. Now I want to install my shell script on existing HDI cluster.

I see most of the examples has Installing HDIcluster + ScriptAction in the same template. Refer https://github.com/Azure/azure-quickstart-templates/blob/master/hdinsight-linux-run-script-action/azuredeploy.json

How do I install custom script on existing HDI cluster using ARM template?

2
@4c74356b41 Updated my question.Galet
well, generally speaking you should use the same json and extend it with script extension4c74356b41

2 Answers

2
votes

An ARM template is for cluster creation or the addition of new nodes to the cluster.

You'll want to run your script action using PowerShell, AzureCLI, or the portal. Here is how you would do it in PowerShell:

    # LOGIN TO ZURE
 Login-AzureRmAccount

 # PROVIDE VALUES FOR THESE VARIABLES
 $clusterName = "<HDInsightClusterName>"            # HDInsight cluster name
 $saName = "<ScriptActionName>"                  # Name of the script action
 $saURI = "<URI to the script>"                  # The URI where the script is located

$nodeTypes = "headnode", "workernode"

Submit-AzureRmHDInsightScriptAction -ClusterName $clusterName -Name $saName -Uri $saURI -NodeTypes $nodeTypes -PersistOnSucces

Resources: https://docs.microsoft.com/en-us/azure/hdinsight/hdinsight-hadoop-customize-cluster-linux

1
votes

As you mentioned, we can apply the script actions during cluster creation. But it is not supported to apply script actions on a running cluster from Azure Resource Manager Template currently. We can get more details about Script Actions from the document.

enter image description here

As Andrew Moll mentioned that we can use Powershell to add Script Actions on running cluster.

We can also can use REST API(linux cluster only) to do that easily. If we have any idea about it, we can give our feedback to Azure team.