-
Notifications
You must be signed in to change notification settings - Fork 0
/
HDInsight-Basic.ps1
43 lines (37 loc) · 1.66 KB
/
HDInsight-Basic.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Primary storage account info
$storageAccountResourceGroupName = "StorageRGName-RG"
$storageAccountName = "StorageAccountName"
$storageAccountKey = (Get-AzureRmStorageAccountKey -ResourceGroupName $storageAccountResourceGroupName -Name $storageAccountName)[0].value
$storageContainer = "StorageContainer"
# Cluster configuration info
$location = "westeurope"
$clusterResourceGroupName = "Cluster-RG"
$clusterName = "Cluster-Name"
$clusterCreds = Get-Credential
$sshCreds = Get-Credential
# If the cluster's resource group doesn't exist yet, run:
# New-AzureRmResourceGroup -Name $clusterResourceGroupName -Location $location
# Hive metastore info
$hiveSqlServer = "ClusterMetaStore"
$hiveDb = "ClusterMetaStoreDB"
$hiveCreds = Get-Credential
$clusterType = "Spark"
$clusterOS = "Linux"
# Create the cluster
New-AzureRmHDInsightClusterConfig -ClusterType $clusterType `
| Add-AzureRmHDInsightMetastore `
-SqlAzureServerName "$hiveSqlServer.database.windows.net" `
-DatabaseName $hiveDb `
-Credential $hiveCreds `
-MetastoreType HiveMetastore `
| New-AzureRmHDInsightCluster `
-OSType $clusterOS `
-ClusterSizeInNodes 2 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-SshCredential $sshCreds `
-Location $location `
-DefaultStorageAccountName "$storageAccountName.blob.core.windows.net" `
-DefaultStorageAccountKey $storageAccountKey `
-DefaultStorageContainer $storageContainer