Database Reference
In-Depth Information
{
Console.WriteLine("Cluster: {0}, Nodes: {1}", item.Name, item.ClusterSizeInNodes);
}
}
public static void CreateCluster()
{
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);
//Cluster information
var clusterInfo = new ClusterCreateParameters()
{
Name = "AutomatedHDICluster",
Location = "East US",
DefaultStorageAccountName = Constants.storageAccount,
DefaultStorageAccountKey = Constants.storageAccountKey,
DefaultStorageContainer = Constants.container,
UserName = Constants.clusterUser,
Password = Constants.clusterPassword,
ClusterSizeInNodes = 2
};
var clusterDetails = client.CreateCluster(clusterInfo);
console.WriteLine("Cluster Created");
ListClusters();
}
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");
console.WriteLine("Cluster Deleted");
ListClusters();
}
}
}
Windows Azure also exposes a set of PowerShell cmdlets for HDInsight to automate cluster management and job
submissions. You can consider cmdlets as prebuilt PowerShell scripts that do specific tasks for you. The next section
describes the PowerShell cmdlets for HDInsight for cluster provisioning.
 
Search WWH ::




Custom Search