azure - Invoke-AzureRmHDInsightHiveJob :远程服务器返回错误:(404)未找到
问题描述
我正在尝试使用 powershell 对我的 HDInsight 群集运行 Hive 查询。Hadoop 作业成功完成,因为我可以在 yarn UI 中看到日志。但是该Invoke-AzureRmHDInsightHiveJob
命令失败并出现以下错误。我做错了什么?
这是完整的代码:
$RunAsConnection = Get-AutomationConnection -Name AzureRunAsConnection;
try
{
$Login=Add-AzureRmAccount -ServicePrincipal -TenantId $RunAsConnection.TenantId -ApplicationId $RunAsConnection.ApplicationId -CertificateThumbprint $RunAsConnection.CertificateThumbprint -ErrorAction Stop
}
catch
{
Sleep 10;
$Login=Add-AzureRmAccount -ServicePrincipal -TenantId $RunAsConnection.TenantId -ApplicationId $RunAsConnection.ApplicationId -CertificateThumbprint $RunAsConnection.CertificateThumbprint
};
Set-AzureRmContext -SubscriptionId $RunAsConnection.SubscriptionID
Connect-AzureRmAccount -ServicePrincipal -Tenant $RunAsConnection.TenantID -ApplicationId $RunAsConnection.ApplicationID -CertificateThumbprint $RunAsConnection.CertificateThumbprint
$ResourceGroupName = "xxxxxx"
$StorageAccountName = "xxxxxx"
$StorageAccountKey = (Get-AzureRmStorageAccountKey -ResourceGroupName $ResourceGroupName -AccountName $StorageAccountName).Value[0]
$StorageAccountName -StorageAccountKey $StorageAccountKey
$StorageAccountContainer = "xxxxxx"
$clusterName = "xxxxxx"
$creds=Get-Credential -Message "Enter the login for the cluster"
Use-AzureRmHDInsightCluster -ClusterName $clusterName -HttpCredential $creds
$queryString = "select 1"
Invoke-AzureRmHDInsightHiveJob -Query $queryString -Verbose -DefaultStorageAccountName "$StorageAccountName.blob.core.windows.net" -DefaultStorageAccountKey $StorageAccountKey -DefaultContainer $StorageAccountContainer
解决方案
推荐阅读
- python - 在python中将网络实现与RSA混合
- amazon-web-services - 使用 AWS lambda 函数从 SNS 主题触发器读取和复制 S3 库存数据
- javascript - 如何使用 Jquery 修复不正确的值拖到 drop 函数
- django - How does Django model save data that is cleaned?
- c# - “帮手”类——如何更好的实现
- bar-chart - 了解python代码以创建人口金字塔
- python - itertools.groupby 无法通过外键正确分组 django 查询集
- python - Docker pip依赖安装错误
- django - 如何通过 Django 中的员工状态过滤经过身份验证的用户?我有麻烦了
- java - 如何使用 Spring 制作用于将图像插入服务器的 Web 服务?