Set-AzureRmHDInsightDefaultStorage
在叢集組態物件中設定預設 儲存體 帳戶設定。
警告
自 2024 年 2 月 29 日起,AzureRM PowerShell 模組已正式淘汰。 建議使用者從 AzureRM 遷移至 Az PowerShell 模組,以確保持續支援和更新。
雖然 AzureRM 模組可能仍可運作,但不再維護或支援它,但會根據用戶的判斷權和風險放置任何繼續使用。 如需轉換至 Az 模組的指引,請參閱我們的 移轉資源 。
語法
Set-AzureRmHDInsightDefaultStorage
[-Config] <AzureHDInsightConfig>
[-StorageAccountName] <String>
[[-StorageAccountKey] <String>]
[-StorageAccountType <StorageType>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Set-AzureRmHDInsightDefault 儲存體 Cmdlet 會在 New-AzureRmHDInsightClusterConfig Cmdlet 所建立的 Azure HDInsight 叢集組態物件中設定預設 儲存體 帳戶設定。
範例
範例 1:設定叢集組態對象的預設記憶體帳戶
PS C:\># Primary storage account info
PS C:\> $storageAccountResourceGroupName = "Group"
PS C:\> $storageAccountName = "yourstorageacct001"
PS C:\> $storageAccountKey = (Get-AzureRmStorageAccountKey -ResourceGroupName $storageAccountResourceGroupName -Name $storageAccountName)[0].value
PS C:\>$storageContainer = "container002"
# Cluster configuration info
PS C:\> $location = "East US 2"
PS C:\> $clusterResourceGroupName = "Group"
PS C:\> $clusterName = "your-hadoop-002"
PS C:\> $clusterCreds = Get-Credential
# If the cluster's resource group doesn't exist yet, run:
# New-AzureRMResourceGroup -Name $clusterResourceGroupName -Location $location
# Create the cluster
PS C:\> New-AzureRmHDInsightClusterConfig `
| Set-AzureRmHDInsightDefaultStorage `
-StorageAccountName "$secondStorageAccountName.blob.core.contoso.net" `
-StorageAccountKey $key2 `
-StorageContainer $storageContainer `
| New-AzureRmHDInsightCluster `
-ClusterType Hadoop `
-OSType Windows `
-ClusterSizeInNodes 4 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location
此命令會設定叢集組態對象的預設 儲存體 帳戶。
參數
-Config
指定此 Cmdlet 修改的 HDInsight 叢集組態物件。 此物件是由 New-AzureRmHDInsightClusterConfig Cmdlet 所建立。
類型: | AzureHDInsightConfig |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-DefaultProfile
用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶
類型: | IAzureContextContainer |
別名: | AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-StorageAccountKey
指定 HDInsight 叢集將使用之預設 Azure 儲存體 帳戶的帳戶的帳戶金鑰。
類型: | String |
Position: | 2 |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-StorageAccountName
指定 HDInsight 叢集將使用的預設記憶體帳戶名稱。
類型: | String |
Position: | 1 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-StorageAccountType
取得或設定預設記憶體帳戶的類型。 預設為 Azure 儲存體
類型: | Nullable<T>[StorageType] |
接受的值: | AzureStorage, AzureDataLakeStore |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
輸入
參數:設定(ByValue)