使用AzureHDInsightCluster会引发错误

时间:2013-12-07 13:34:23

标签: powershell azure hdinsight

我正在尝试使用Use-AzureHDInsightCluster powershell cmdlet

Use-AzureHDInsightCluster "mycluster" -Subscription (Get-AzureSubscription -Current).SubscriptionId

但是我收到以下错误。我不知道从哪里开始,因为我是新手。

Use-AzureHDInsightCluster : An error occurred while sending the request.
At line:1 char:1
+ Use-AzureHDInsightCluster "mycluster" -Subscription (Get-AzureSubscription -Cu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Use-AzureHDInsightCluster], HttpRequestException
+ FullyQualifiedErrorId : System.Net.Http.HttpRequestException,Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.
PSCmdlets.UseAzureHDInsightClusterCmdlet

编辑我添加了调试标志,我得到了更多信息

DEBUG: Severity: Error
One or more errors occurred.
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken       cancellationToken)
   at Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.PSCmdlets.UseAzureHDInsightClusterCmdlet.EndProcessing()
An error occurred while sending the request.
at System.Threading.Tasks.TaskAwaiter`1.GetResult()
at
Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.Commands.CommandImplementations.UseAzureHDInsightClusterCommand.<End
Processing>d__0.MoveNext()
Unable to connect to the remote server
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
An attempt was made to access a socket in a way forbidden by its access permissions    70.37.71.239:8443
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6,  Socket& socket,
IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)

2 个答案:

答案 0 :(得分:0)

从下面的文件夹中删除WindowsAzureProfile.xml,然后重试: C:\ Users \ xxxx \ AppData \ Roaming \ Windows Azure Powershell

答案 1 :(得分:-1)

错误消息不是很有用,不是吗。 PowerShell有一些常见的开关。其中两个有助于调试。他们是-debug和-verbose。使用两个开关重试该命令并获取详细信息。

“mycluster”是有效的群集名称吗?这是你用于这篇文章的名字吗?您可以使用以下命令测试Windows Azure连接:

GET-AzureSubscription 得到-AzureHDInsightCluster

如果您没有收到订阅,也没有收到群集列表。您可能需要先修复连接。有关连接到Azure帐户的信息,请参阅http://www.windowsazure.com/en-us/manage/install-and-configure-windows-powershell/