你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Add-AzHDInsightStorage
将 Azure 存储密钥添加到群集配置对象。
语法
Add-AzHDInsightStorage
[-Config] <AzureHDInsightConfig>
[-StorageAccountName] <String>
[-StorageAccountKey] <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Add-AzHDInsightStorage cmdlet 将 Azure 存储帐户条目添加到 New-AzHDInsightClusterConfig cmdlet 创建的 Azure HDInsight 配置对象。
示例
示例 1:将 Azure 存储密钥添加到群集配置对象
# Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageAccountName = "yourstorageacct001"
$storageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $storageAccountResourceGroupName -Name $storageAccountName)[0].value
$storageContainer = "container001"
# Cluster configuration info
$location = "East US 2"
$clusterResourceGroupName = "Group"
$clusterName = "your-hadoop-001"
$clusterCreds = Get-Credential
# If the cluster's resource group doesn't exist yet, run:
# New-AzResourceGroup -Name $clusterResourceGroupName -Location $location
# Second storage account info
$secondStorageAccountResourceGroupName = "Group"
$secondStorageAccountName = "yourstorageacct002"
$secondStorageAccountKey = Get-AzStorageAccountKey `
-ResourceGroupName $secondStorageAccountResourceGroupName `
-Name $secondStorageAccountName | ForEach-Object{ $_.Key1 }
# Create the cluster
New-AzHDInsightClusterConfig `
| Add-AzHDInsightStorage `
-StorageAccountName "$secondStorageAccountName.blob.core.contoso.net" `
-StorageAccountKey $key2 `
| New-AzHDInsightCluster `
-ClusterType Hadoop `
-OSType Windows `
-ClusterSizeInNodes 4 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountKey $storageAccountKey `
-StorageContainer $storageContainer
此命令将 Blob 存储帐户条目添加到名为 your-hadoop-001 的 HDInsight 配置。
参数
-Config
指定此 cmdlet 修改的 HDInsight 群集配置对象。 此对象由 New-AzHDInsightClusterConfig cmdlet 创建。
类型: | AzureHDInsightConfig |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-DefaultProfile
用于与 azure 通信的凭据、帐户、租户和订阅
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-StorageAccountKey
指定要添加到新群集的存储帐户的存储帐户密钥。
类型: | String |
Position: | 2 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-StorageAccountName
指定要添加到群集的存储帐户的存储帐户名称。
类型: | String |
Position: | 1 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |