Database Reference
In-Depth Information
UserName = Constants.clusterUser,
Password = Constants.clusterPassword,
ClusterSizeInNodes = 2
};
var clusterDetails = client.CreateCluster(clusterInfo);
ListClusters();
}
When you execute this method by similarly adding a call in Main() , you will see that a new cluster deployment
has started in the Windows Azure Management Portal, as shown in Figure 4-7 .
Figure 4-7. New cluster provisioning
Once the virtual machines are configured and the cluster creation is complete, you will see the cluster URL in
your console application output. For example:
Created cluster: https://AutomatedHDICluster.azurehdinsight.net
You can call the ShowClusters() method again, and this time it will display three HDInsight clusters along with
the new one just deployed:
Cluster: AutomatedHDICluster, Nodes: 2
Cluster: datadork, Nodes: 4
Cluster: democluster, Nodes: 4
You can also drop a cluster using the DeleteCluster() method of the .NET SDK. The code snippet in Listing 4-4
shows how to call the DeleteCluster() function.
Listing 4-4. The DeleteCluster( ) Method
public static void DeleteCluster()
{
var store = new X509Store();
store.Open(OpenFlags.ReadOnly);
var cert = store.Certificates.Cast<X509Certificate2>().
First(item => item.Thumbprint == Constants.thumbprint);
var creds = new HDInsightCertificateCredential(Constants.subscriptionId, cert);
var client = HDInsightClient.Connect(creds);
client.DeleteCluster("AutomatedHDICluster");
ListClusters();
}
 
Search WWH ::




Custom Search