Database Reference
In-Depth Information
Figure 4-6. The ListClusters( ) method
You can use the CreateCluster() method of the SDK to programmatically deploy your HDInsight cluster.
You will need to provide few mandatory parameters such as cluster name, location, storage account, and so on while
calling the CreateCluster() method. Listing 4-3 contains the code block to provision a new cluster with two data
nodes through .NET code.
Listing 4-3. The CreateCluster( ) Method
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,
 
Search WWH ::




Custom Search