HDInsight 群集与 Metastore 使用 powershell 错误
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 和地区 => 美国东部
如果您无法在 region/zone 中找到合适的 SKU 或满足您业务需求的替代 region/zone,请向 Azure 支持提交 SKU request or Quota increase。
我正在尝试使用 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 和地区 => 美国东部
如果您无法在 region/zone 中找到合适的 SKU 或满足您业务需求的替代 region/zone,请向 Azure 支持提交 SKU request or Quota increase。