你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Add-AzHDInsightComponentVersion

将群集中运行的服务的版本添加到群集配置对象。

语法

Add-AzHDInsightComponentVersion
   [-Config] <AzureHDInsightConfig>
   [-ComponentName] <String>
   [-ComponentVersion] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

说明

Add-AzHDInsightComponentVersion cmdlet 将群集中运行的服务的版本添加到由 New-AzHDInsightClusterConfig cmdlet 创建的 Azure HDInsight 配置对象。

示例

示例 1:将 Spark 的版本添加到群集配置对象。

# Primary storage account info
        $storageAccountResourceGroupName = "Group"
        $storageAccountName = "yourstorageacct001"
        $storageAccountResourceId = "yourstorageaccountresourceid"
        $storageAccountKey = Get-AzStorageAccountKey `
            -ResourceGroupName $storageAccountResourceGroupName `
            -Name $storageAccountName | ForEach-Object{ $_.Key1 }
        $storageContainer = "container001"

        # Cluster configuration info
        $location = "East US 2"
        $clusterResourceGroupName = "Group"
        $clusterName = "your-spark-001"
        $clusterCreds = Get-Credential
        $sshClusterCreds = Get-Credential

        # If the cluster's resource group doesn't exist yet, run:
        #   New-AzResourceGroup -Name $clusterResourceGroupName -Location $location

        # Create the cluster
        New-AzHDInsightClusterConfig `
            | Add-AzHDInsightComponentVersion `
                -ComponentName "Spark" `
                -ComponentVersion "2.0" `
            | New-AzHDInsightCluster `
                -ClusterType Spark `
                -OSType Linux `
                -ClusterSizeInNodes 4 `
                -ResourceGroupName $clusterResourceGroupName `
                -ClusterName $clusterName `
                -HttpCredential $clusterCreds `
                -Location $location `
                -StorageAccountResourceId $storageAccountResourceId `
                -StorageAccountKey $storageAccountKey `
                -StorageContainer $storageContainer `
                -SshCredential $sshCredentials `
                -Version "3.5"

此命令将 Spark 版本添加到名为“your-spark-001”的 HDInsight 群集。

参数

-ComponentName

Type:String
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-ComponentVersion

Type:String
Position:2
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Config

Type:AzureHDInsightConfig
Position:0
Default value:None
Accept pipeline input:True
Accept wildcard characters:False

-Confirm

提示你在运行 cmdlet 之前进行确认。

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

用于与 Azure 通信的凭据、帐户、租户和订阅

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

输入

AzureHDInsightConfig

输出

AzureHDInsightConfig