繁体   English   中英

使用 powershell 错误的 Metastore 的 HDInsight 群集

[英]HDInsight cluster with metastore using powershell error

我正在尝试使用 Powershell 脚本在 Azure 中使用 Metastore 创建 HDInsight 集群。 但它抛出 BadRequest: RegionCapabilityNotAvailable,Region capability not available for region 'East US' 错误。 但美国东部是 HDInsight 群集的受支持区域。 请在下面找到我的代码。

$storageAccountResourceGroupName = "hdi-rg"
$storageAccountName = "qwertyhdi"
#$storageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $storageAccountResourceGroupName -Name $storageAccountName)[0].value
$storageContainer = "qwertyiopasdf-2020-05-03t08-30-23-118z"

# Cluster configuration info
$location = "East US"
$clusterResourceGroupName = "hdi-rg"
$clusterName = "qwertyiopasdf"
$username = "admin"
$password = ConvertTo-SecureString "password" -AsPlainText -Force
$clusterCreds = New-Object System.Management.Automation.PSCredential -ArgumentList ($username, $password)

# Hive metastore info
$hiveSqlServer = "server"
$hiveDb = "db123"
$sqlusername = "qwerty"
$sqlpassword = ConvertTo-SecureString "password" -AsPlainText -Force
$hiveCreds = New-Object System.Management.Automation.PSCredential -ArgumentList ($sqlusername, $sqlpassword)

New-AzStorageAccount `
    -ResourceGroupName $storageAccountResourceGroupName `
    -Name $storageAccountName `
    -Location $location `
    -SkuName Standard_LRS `
    -Kind StorageV2 `
    -EnableHttpsTrafficOnly 1

# Note: Storage account kind BlobStorage cannot be used as primary storage.

$storageAccountKey = (Get-AzStorageAccountKey `
                                -ResourceGroupName $storageAccountResourceGroupName `
                                -Name $storageAccountName)[0].Value

$defaultStorageContext = New-AzStorageContext `
                                -StorageAccountName $storageAccountName `
                                -StorageAccountKey $storageAccountKey

New-AzStorageContainer `
    -Name $storageContainer `
    -Context $defaultStorageContext #use the cluster name as the container name


$metastore = New-AzHDInsightClusterConfig | Add-AzHDInsightMetastore -SqlAzureServerName "$hiveSqlServer.database.windows.net" -DatabaseName $hiveDb -Credential $hiveCreds -MetastoreType HiveMetastore


New-AzHDInsightCluster -Location $location -ResourceGroupName $clusterResourceGroupName -ClusterName $clusterName -ClusterType Hadoop -OSType Windows -ClusterSizeInNodes 1 -HttpCredential $clusterCreds -DefaultStorageAccountName "$storageAccountName.blob.core.windows.net" -DefaultStorageAccountKey $storageAccountKey -DefaultStorageContainer $storageContainer -Config $metastore

-OSType Windows 是否仍然有效。 我意识到“Windows”被列为 PowerShell 规范中的一个选项,但我认为“linux”是唯一可行的值。

当底层计算 sku 不适用于该订阅中的选定区域时,您将收到此错误消息BadRequest: RegionCapabilityNotAvailable,Region capability not available for region 'East US'

我会要求您检查该资源是否可从 Azure 门户网站获得。

Azure 门户 => Select 您的订阅 => 使用 + 配额

使用 => Microsoft.Compute 和区域 => 美国东部进行过滤

在此处输入图像描述

如果您无法在该地区/地区或满足您业务需求的替代地区/地区找到合适的 SKU,请向 Azure 支持提交SKU 请求增加配额

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM