你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Set-AzHDInsightDefaultStorage
在群集配置对象中设置默认存储帐户设置。
语法
Set-AzHDInsightDefaultStorage
[-Config] <AzureHDInsightConfig>
[-StorageAccountResourceId] <String>
[[-StorageAccountKey] <String>]
[-StorageAccountType <StorageType>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Set-AzHDInsightDefaultStorage cmdlet 在 New-AzHDInsightClusterConfig cmdlet 创建的 Azure HDInsight 群集配置对象中设置默认存储帐户设置。
示例
示例 1:为群集配置对象设置默认存储帐户
# Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageAccountName = "yourstorageaccountname"
$storageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $storageAccountResourceGroupName -Name $storageAccountName)[0].value
$storageType = "AzureStorage"
# Cluster configuration info
$location = "East US 2"
$clusterResourceGroupName = "Group"
$clusterName = "your-hadoop-002"
$clusterCreds = Get-Credential
# If the cluster's resource group doesn't exist yet, run:
# New-AzResourceGroup -Name $clusterResourceGroupName -Location $location
# Create the cluster
New-AzHDInsightClusterConfig `
| Set-AzHDInsightDefaultStorage `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountKey $key2 `
-StorageAccountType $storageType `
| New-AzHDInsightCluster `
-ClusterType Hadoop `
-OSType Windows `
-ClusterSizeInNodes 4 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location
此命令设置群集配置对象的默认存储帐户。
参数
-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
指定 HDInsight 群集将使用的默认 Azure 存储帐户的帐户密钥。
类型: | String |
Position: | 2 |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-StorageAccountResourceId
要添加到新群集的存储帐户的存储帐户名称。
类型: | String |
Position: | 1 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-StorageAccountType
获取或设置默认存储帐户的类型。 默认为 AzureStorage
类型: | Nullable<T>[StorageType] |
接受的值: | AzureStorage, AzureDataLakeStore, AzureDataLakeStorageGen2 |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |