Azure 使用powershell创建HDCluster

Azure 使用powershell创建HDCluster,azure,azure-hdinsight,azure-powershell,Azure,Azure Hdinsight,Azure Powershell,我正在尝试使用powershell创建群集。下面是我正在执行的脚本: $containerName = "hdfiles" $location = "Southeast Asia" $clusterNodes = 2 $userName = "HDUser" #Generate random password $rand = New-Object System.Random $pass = "" $pass = $pass + [char]$rand.next(97,121) #lower c

我正在尝试使用powershell创建群集。下面是我正在执行的脚本:

$containerName = "hdfiles"
$location = "Southeast Asia"
$clusterNodes = 2
$userName = "HDUser"

#Generate random password
$rand = New-Object System.Random
$pass = ""
$pass = $pass + [char]$rand.next(97,121) #lower case
$pass = $pass + [char]$rand.next(48,57) #number
$pass = $pass + [char]$rand.next(65,90) #upper case
$pass = $pass + [char]$rand.next(58,62) #special character
1..6 | ForEach { $pass = $pass + [char]$rand.next(97,121) } #6 lower-case characters
$password = ConvertTo-SecureString $pass -AsPlainText -Force

# generate unique random cluster and storage account names
do
{
  $clusterName = "hd"
  1..6 | ForEach { $clusterName = $clusterName + [char]$rand.next(48,57) }
  $storageAccountName = $clusterName + "store"
}
while ((Test-AzureName -Name $storageAccountName -Storage) -and (Test-AzureName -Name $clusterName -Service))

# Create a storage account
Write-Host "Creating storage account..."
New-AzureStorageAccount -StorageAccountName $storageAccountName -Location $location

# Create a Blob storage container
Write-Host "Creating container..."
$storageAccountKey = Get-AzureStorageKey $storageAccountName | %{ $_.Primary }
$destContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey
New-AzureStorageContainer -Name $containerName -Context $destContext

# Create a cluster
Write-Host "Creating HDInsight cluster..."
$credential = New-Object System.Management.Automation.PSCredential ($userName, $password)
New-AzureHDInsightCluster -Name $clusterName -Location $location -DefaultStorageAccountName "$storageAccountName.blob.core.windows.net" -DefaultStorageAccountKey $storageAccountKey -DefaultStorageContainerName $containerName -ClusterSizeInNodes $clusterNodes -Credential $credential -Version 3.2
但在最后一行,我得到了一个例外:

New-AzureHDInsightCluster : Validating connection to 'hd662173store.blob.core.windows.net' failed. Inner exception:Could not load file or assembly 'Microsoft.WindowsAzure.Storage, Version=3.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
At D:\ProgrammingWorkspace\Edx\Processing BigData with HDInsight\HDILabs\Lab02A\Provision HDInsight.ps1:38 char:1 + New-AzureHDInsightCluster -Name $clusterName -Location $location -Def ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [New-AzureHDInsightCluster], ConfigurationErrorsException
+ FullyQualifiedErrorId : System.Configuration.ConfigurationErrorsException,Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.PSCmdlets.NewAzureHDInsightClusterCmdlet

我正在使用Azure Powershell版本0.9.7和Azure SDK 2.7。回顾这一点,您遇到的问题现在可能已通过最新版本的Azure Powershell得到修复

要安装最新版本的Azure PowerShell,请参阅此处:

有关如何使用HDInsight PowerShell cmdlet的示例(例如,新AzureRmHDInsightCluster),请参见此处:


我希望这有帮助

编辑添加:我的道歉!结果发现我搜索的关键词在相关部分。您是否尝试重新安装Azure SDK并重新启动?在这里检查是的,几次。实际上在SDK文件夹中我有这个库,但版本是5.0.0