Skip to content

Demonstrate how to apply a script action to a running Linux-based HDInsight cluster

Notifications You must be signed in to change notification settings

nbikhchandani/hdinsight-dotnet-script-action

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

services platforms author
hdinsight
dotnet
blackmist

Apply a Script Action against a running Linux-based HDInsight cluster

Script Actions can be used to customize HDInsight clusters by performing custom configuration or installing additional software components. Until March 2016, you could only use Script Actions when creating a cluster. Now, you can apply Script Actions both during cluster creation and to a running Linux-based cluster (Windows-based clusters are still limited to only using Script Actions during cluster creation.)

This example shows how to work with Script Actions on a running cluster using the .NET SDK for HDInsight.

##How to use

  1. Create a Linux-based HDInsight cluster.

  2. Copy this project locally and open in Visual Studio 2015.

  3. Modify the following lines to add your Azure subscription ID, HDInsight cluster name, and the Azure Resource Group that the cluster was created in.

     // Replace the following with your Azure subscription ID    
     private static Guid SubscriptionId = new Guid("Subscription ID GUID");
     // Replace the following with your HDInsight cluster ID
     private const string ClusterName = "Cluster Name";
     // Replace the following with the Azure resource group that contains the cluster
     private const string ResourceGroupName = "Resource Group Name";
    
  4. Run the project. It will install Giraph on the cluster using a Script Action, then display a history of the Script actions ran on the cluster.

  5. Optionally, you can uncomment the following line to promote a Script Action to persist it. If you scale your cluster to add new nodes, any persisted Script Action that targets worker nodes will be applied to the new worker nodes.

     // _hdiManagementClient.Clusters.PromoteScript(ResourceGroupName, ClusterName, <scriptexecutionid>);
    

    If you no longer want to apply a script when adding nodes to the cluster, you can demote it using DeletePersistedScript.

     // _hdiManagementClient.Clusters.DeletePersistedScript(ResourceGroupName, ClusterName, "<scriptname>");
    

For more information on using Script Actions, see Customize HDInsight clusters using Script Actions.

About

Demonstrate how to apply a script action to a running Linux-based HDInsight cluster

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%