Wednesday 15 June 2016

HdInsight Cluster Create Script - PART 3

Import-Module "C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Azure.psd1"
$resourceGroupName = "xxxxRG"
$storageAccountName = "saxxxx"
$containerName = "linuxhdinsightclusterxxxx"
$storageAccountKey = "nNoxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx90A=="
$subscriptionName = "xxxxxxxxxxxx"
$storageAccountLocation = "North Central US"
$clusterName = "linuxhdinsightclusterxxxx"
$clusterNodeCount = "8"
$azUserName = "xxxxxxxx@outlook.com"
$azUserPW = ConvertTo-SecureString -String "xxxxxxxxxx" -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($azUserName, $azUserPW)
Login-AzureRmAccount -Credential $cred
Select-AzureRmSubscription -SubscriptionName $subscriptionName
$blobStorageName = "saxxxx.blob.core.windows.net"
$sshUserName = "admin123"
$sshUserPwd = "Test@45678"
$sshUserPW = ConvertTo-SecureString -String $sshUserPwd -AsPlainText -Force
$sshCredentials = New-Object System.Management.Automation.PSCredential($sshUserName,$sshUserPW)
$computerName = "linuxhdinsightclusterxxxx-ssh.azurehdinsight.net"
$htpUserName = "admin"
$htpUserPwd = "Test@45678"
$htpUserPW = ConvertTo-SecureString -String $htpUserPwd -AsPlainText -Force
$credentials = New-Object System.Management.Automation.PSCredential($htpUserName,$htpUserPW)
$oozieUserName = "rootx"
$oozieUserPwd = "Test@45678"
$oozieUserPW = ConvertTo-SecureString -String $oozieUserPwd -AsPlainText -Force
$oozieCred = New-Object System.Management.Automation.PSCredential($oozieUserName,$oozieUserPW)
$config = New-AzureRmHDInsightClusterConfig
$config = Add-AzureRmHDInsightScriptAction -Config $config -Name "Install Hue"  -NodeType HeadNode  -Parameters "Test@45678" -Uri https://hdiconfigactions.blob.core.windows.net/linuxhueconfigactionv01/install-hue-uber-v01.sh
$config = Add-AzureRmHDInsightScriptAction -Config $config -Name "Install R"  -NodeType HeadNode -Uri https://hdiconfigactions.blob.core.windows.net/linuxrconfigactionv01/r-installer-v01.sh
$config = Add-AzureRmHDInsightScriptAction -Config $config -Name "Install R"  -NodeType WorkerNode -Uri https://hdiconfigactions.blob.core.windows.net/linuxrconfigactionv01/r-installer-v01.sh
$config = Add-AzureRmHDInsightScriptAction -Config $config -Name "Install Solr"  -NodeType HeadNode  -Uri https://hdiconfigactions.blob.core.windows.net/linuxsolrconfigactionv01/solr-installer-v01.sh
$config = Add-AzureRmHDInsightScriptAction -Config $config -Name "Install Solr"  -NodeType WorkerNode -Uri https://hdiconfigactions.blob.core.windows.net/linuxsolrconfigactionv01/solr-installer-v01.sh

New-AzureRmHDInsightCluster -ClusterName $clusterName -config $config -ResourceGroupName $resourceGroupName -HttpCredential $credentials -Location $storageAccountLocation -DefaultStorageAccountName "$storageAccountName.blob.core.windows.net" -DefaultStorageAccountKey $storageAccountKey -DefaultStorageContainer $containerName  -ClusterSizeInNodes $clusterNodeCount -ClusterType "Spark" -OSType "Linux" -Version "3.4" -SshCredential $sshCredentials
Invoke-Expression "C:\Cluster\bootup.ps1"

No comments:

Post a Comment