你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzHDInsightCluster
在当前订阅的指定资源组中创建 Azure HDInsight 群集。
语法
New-AzHDInsightCluster
[-Location] <String>
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-ClusterSizeInNodes] <Int32>
[-HttpCredential] <PSCredential>
[[-StorageAccountResourceId] <String>]
[[-StorageAccountKey] <String>]
[-StorageAccountType <StorageType>]
[-EnableSecureChannel <Boolean>]
[-Config <AzureHDInsightConfig>]
[-OozieMetastore <AzureHDInsightMetastore>]
[-HiveMetastore <AzureHDInsightMetastore>]
[-AmbariDatabase <AzureHDInsightMetastore>]
[-AdditionalStorageAccounts <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[-Configurations <System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.Dictionary`2[System.String,System.String]]>]
[-ScriptActions <System.Collections.Generic.Dictionary`2[Microsoft.Azure.Management.HDInsight.Models.ClusterNodeType,System.Collections.Generic.List`1[Microsoft.Azure.Commands.HDInsight.Models.Management.AzureHDInsightScriptAction]]>]
[-StorageContainer <String>]
[-StorageRootPath <String>]
[-StorageFileSystem <String>]
[-Version <String>]
[-HeadNodeSize <String>]
[-WorkerNodeSize <String>]
[-EdgeNodeSize <String>]
[-KafkaManagementNodeSize <String>]
[-ZookeeperNodeSize <String>]
[-ClusterType <String>]
[-ComponentVersion <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[-VirtualNetworkId <String>]
[-SubnetName <String>]
[-OSType <String>]
[-ClusterTier <String>]
[-SshCredential <PSCredential>]
[-SshPublicKey <String>]
[-ObjectId <Guid>]
[-ApplicationId <Guid>]
[-CertificatePassword <String>]
[-AadTenantId <Guid>]
[-SecurityProfile <AzureHDInsightSecurityProfile>]
[-DisksPerWorkerNode <Int32>]
[-MinSupportedTlsVersion <String>]
[-AssignedIdentity <String>]
[-StorageAccountManagedIdentity <String>]
[-EncryptionAlgorithm <String>]
[-EncryptionKeyName <String>]
[-EncryptionKeyVersion <String>]
[-EncryptionVaultUri <String>]
[-EncryptionInTransit <Boolean>]
[-EncryptionAtHost <Boolean>]
[-AutoscaleConfiguration <AzureHDInsightAutoscale>]
[-EnableIDBroker]
[-KafkaClientGroupId <String>]
[-KafkaClientGroupName <String>]
[-ResourceProviderConnection <String>]
[-PrivateLink <String>]
[-PublicIpTagType <String>]
[-PublicIpTag <String>]
[-OutboundDependenciesManagedType <String>]
[-EnableComputeIsolation]
[-ComputeIsolationHostSku <String>]
[-Zone <String[]>]
[-Tag <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[-PrivateLinkConfiguration <AzureHDInsightPrivateLinkConfiguration[]>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
New-AzHDInsightCluster
[-Location] <String>
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-ClusterSizeInNodes] <Int32>
[-HttpCredential] <PSCredential>
[[-StorageAccountResourceId] <String>]
[[-StorageAccountKey] <String>]
[-StorageAccountType <StorageType>]
[-EnableSecureChannel <Boolean>]
[-Config <AzureHDInsightConfig>]
[-OozieMetastore <AzureHDInsightMetastore>]
[-HiveMetastore <AzureHDInsightMetastore>]
[-AmbariDatabase <AzureHDInsightMetastore>]
[-AdditionalStorageAccounts <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[-Configurations <System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.Dictionary`2[System.String,System.String]]>]
[-ScriptActions <System.Collections.Generic.Dictionary`2[Microsoft.Azure.Management.HDInsight.Models.ClusterNodeType,System.Collections.Generic.List`1[Microsoft.Azure.Commands.HDInsight.Models.Management.AzureHDInsightScriptAction]]>]
[-StorageContainer <String>]
[-StorageRootPath <String>]
[-StorageFileSystem <String>]
[-Version <String>]
[-HeadNodeSize <String>]
[-WorkerNodeSize <String>]
[-EdgeNodeSize <String>]
[-KafkaManagementNodeSize <String>]
[-ZookeeperNodeSize <String>]
[-ClusterType <String>]
[-ComponentVersion <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[-VirtualNetworkId <String>]
[-SubnetName <String>]
[-OSType <String>]
[-ClusterTier <String>]
[-SshCredential <PSCredential>]
[-SshPublicKey <String>]
[-ObjectId <Guid>]
[-ApplicationId <Guid>]
[-CertificateFilePath <String>]
[-CertificatePassword <String>]
[-AadTenantId <Guid>]
[-SecurityProfile <AzureHDInsightSecurityProfile>]
[-DisksPerWorkerNode <Int32>]
[-MinSupportedTlsVersion <String>]
[-AssignedIdentity <String>]
[-StorageAccountManagedIdentity <String>]
[-EncryptionAlgorithm <String>]
[-EncryptionKeyName <String>]
[-EncryptionKeyVersion <String>]
[-EncryptionVaultUri <String>]
[-EncryptionInTransit <Boolean>]
[-EncryptionAtHost <Boolean>]
[-AutoscaleConfiguration <AzureHDInsightAutoscale>]
[-EnableIDBroker]
[-KafkaClientGroupId <String>]
[-KafkaClientGroupName <String>]
[-ResourceProviderConnection <String>]
[-PrivateLink <String>]
[-PublicIpTagType <String>]
[-PublicIpTag <String>]
[-OutboundDependenciesManagedType <String>]
[-EnableComputeIsolation]
[-ComputeIsolationHostSku <String>]
[-Zone <String[]>]
[-Tag <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[-PrivateLinkConfiguration <AzureHDInsightPrivateLinkConfiguration[]>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
New-AzHDInsightCluster
[-Location] <String>
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-ClusterSizeInNodes] <Int32>
[-HttpCredential] <PSCredential>
[[-StorageAccountResourceId] <String>]
[[-StorageAccountKey] <String>]
[-StorageAccountType <StorageType>]
[-EnableSecureChannel <Boolean>]
[-Config <AzureHDInsightConfig>]
[-OozieMetastore <AzureHDInsightMetastore>]
[-HiveMetastore <AzureHDInsightMetastore>]
[-AmbariDatabase <AzureHDInsightMetastore>]
[-AdditionalStorageAccounts <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[-Configurations <System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.Dictionary`2[System.String,System.String]]>]
[-ScriptActions <System.Collections.Generic.Dictionary`2[Microsoft.Azure.Management.HDInsight.Models.ClusterNodeType,System.Collections.Generic.List`1[Microsoft.Azure.Commands.HDInsight.Models.Management.AzureHDInsightScriptAction]]>]
[-StorageContainer <String>]
[-StorageRootPath <String>]
[-StorageFileSystem <String>]
[-Version <String>]
[-HeadNodeSize <String>]
[-WorkerNodeSize <String>]
[-EdgeNodeSize <String>]
[-KafkaManagementNodeSize <String>]
[-ZookeeperNodeSize <String>]
[-ClusterType <String>]
[-ComponentVersion <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[-VirtualNetworkId <String>]
[-SubnetName <String>]
[-OSType <String>]
[-ClusterTier <String>]
[-SshCredential <PSCredential>]
[-SshPublicKey <String>]
[-ObjectId <Guid>]
[-ApplicationId <Guid>]
[-CertificateFileContents <Byte[]>]
[-CertificatePassword <String>]
[-AadTenantId <Guid>]
[-SecurityProfile <AzureHDInsightSecurityProfile>]
[-DisksPerWorkerNode <Int32>]
[-MinSupportedTlsVersion <String>]
[-AssignedIdentity <String>]
[-StorageAccountManagedIdentity <String>]
[-EncryptionAlgorithm <String>]
[-EncryptionKeyName <String>]
[-EncryptionKeyVersion <String>]
[-EncryptionVaultUri <String>]
[-EncryptionInTransit <Boolean>]
[-EncryptionAtHost <Boolean>]
[-AutoscaleConfiguration <AzureHDInsightAutoscale>]
[-EnableIDBroker]
[-KafkaClientGroupId <String>]
[-KafkaClientGroupName <String>]
[-ResourceProviderConnection <String>]
[-PrivateLink <String>]
[-PublicIpTagType <String>]
[-PublicIpTag <String>]
[-OutboundDependenciesManagedType <String>]
[-EnableComputeIsolation]
[-ComputeIsolationHostSku <String>]
[-Zone <String[]>]
[-Tag <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[-PrivateLinkConfiguration <AzureHDInsightPrivateLinkConfiguration[]>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
New-AzHDInsightCluster 通过使用指定的参数或使用 New-AzHDInsightClusterConfig cmdlet 创建的配置对象来创建 Azure HDInsight 群集。
cmdlet 可以根据输入参数调用以下Microsoft图形 API:
- GET /servicePrincipals/{id}
示例
示例 1:创建 Azure HDInsight 群集
# Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageAccountName = "yourstorageacct001"
$storageAccountKey = Get-AzStorageAccountKey `
-ResourceGroupName $storageAccountResourceGroupName `
-Name $storageAccountName | Where-Object {$_.KeyName -eq "key1"} | ForEach-Object{$_.Value}
$storageContainer = "container002"
# 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-AzHDInsightCluster `
-ClusterType Hadoop `
-ClusterSizeInNodes 4 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountKey $storageAccountKey `
-StorageContainer $storageContainer `
-SshCredential $clusterCreds
此命令在当前订阅中创建群集。
示例 2:使用客户管理的密钥磁盘加密创建群集
# Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageAccountName = "yourstorageacct001"
$storageAccountKey = Get-AzStorageAccountKey `
-ResourceGroupName $storageAccountResourceGroupName `
-Name $storageAccountName | Where-Object {$_.KeyName -eq "key1"} | ForEach-Object{$_.Value}
$storageContainer = "container002"
# Cluster configuration info
$location = "East US 2"
$clusterResourceGroupName = "Group"
$clusterName = "your-cmk-cluster"
$clusterCreds = Get-Credential
# Customer-managed Key info
$assignedIdentity = "your-ami-resource-id"
$encryptionKeyName = "new-key"
$encryptionVaultUri = "https://MyKeyVault.vault.azure.net"
$encryptionKeyVersion = "00000000000000000000000000000000"
# If the cluster's resource group doesn't exist yet, run:
# New-AzResourceGroup -Name $clusterResourceGroupName -Location $location
# Create the cluster
New-AzHDInsightCluster `
-ClusterType Spark `
-ClusterSizeInNodes 4 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountKey $storageAccountKey `
-StorageContainer $storageContainer `
-SshCredential $clusterCreds `
-AssignedIdentity $assignedIdentity `
-EncryptionKeyName $encryptionKeyName `
-EncryptionVaultUri $encryptionVaultUri `
-EncryptionKeyVersion $encryptionKeyVersion
示例 3:创建启用传输中加密的 Azure HDInsight 群集
# Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageAccountName = "yourstorageacct001"
$storageAccountKey = Get-AzStorageAccountKey `
-ResourceGroupName $storageAccountResourceGroupName `
-Name $storageAccountName | Where-Object {$_.KeyName -eq "key1"} | ForEach-Object{$_.Value}
$storageContainer = "container002"
# 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-AzHDInsightCluster `
-ClusterType Hadoop `
-ClusterSizeInNodes 4 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountKey $storageAccountKey `
-StorageContainer $storageContainer `
-SshCredential $clusterCreds `
-EncryptionInTransit $true
示例 4:使用中继出站和专用链接功能创建 Azure HDInsight 群集
# Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageAccountName = "yourstorageacct001"
$storageAccountKey = Get-AzStorageAccountKey `
-ResourceGroupName $storageAccountResourceGroupName `
-Name $storageAccountName | Where-Object {$_.KeyName -eq "key1"} | ForEach-Object{$_.Value}
$storageContainer = "container002"
# 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
# Virtual network info
$virtualNetworkId="yourvnetresourceid"
$subnetName="yoursubnetname"
# Create the cluster
New-AzHDInsightCluster `
-ClusterType Hadoop `
-ClusterSizeInNodes 4 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountKey $storageAccountKey `
-StorageContainer $storageContainer `
-SshCredential $clusterCreds `
-VirtualNetworkId $virtualNetworkId -SubnetName $subnetName `
-ResourceProviderConnection Outbound -PrivateLink Enabled
示例 5:创建在主机上启用加密的 Azure HDInsight 群集
# Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageAccountName = "yourstorageacct001"
$storageAccountKey = Get-AzStorageAccountKey `
-ResourceGroupName $storageAccountResourceGroupName `
-Name $storageAccountName | Where-Object {$_.KeyName -eq "key1"} | ForEach-Object{$_.Value}
$storageContainer = "container002"
# 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-AzHDInsightCluster `
-ClusterType Hadoop `
-ClusterSizeInNodes 4 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountKey $storageAccountKey `
-StorageContainer $storageContainer `
-SshCredential $clusterCreds `
-EncryptionAtHost $true
示例 6:创建启用自动缩放的 Azure HDInsight 群集。
# Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageAccountName = "yourstorageacct001"
$storageAccountKey = Get-AzStorageAccountKey `
-ResourceGroupName $storageAccountResourceGroupName `
-Name $storageAccountName | Where-Object {$_.KeyName -eq "key1"} | ForEach-Object{$_.Value}
$storageContainer = "container002"
# 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 autoscale configuration
$autoscaleConfiguration=New-AzHDInsightClusterAutoscaleConfiguration `
-MinWorkerNodeCount 3 -MaxWorkerNodeCount 5
# Create the cluster
New-AzHDInsightCluster `
-ClusterType Hadoop `
-ClusterSizeInNodes 4 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountKey $storageAccountKey `
-StorageContainer $storageContainer `
-SshCredential $clusterCreds `
-AutoscaleConfiguration $autoscaleConfiguration
示例 7:使用 Kafka Rest 代理创建 Azure HDInsight 群集。
# Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageAccountName = "yourstorageacct001"
$storageAccountKey = Get-AzStorageAccountKey `
-ResourceGroupName $storageAccountResourceGroupName `
-Name $storageAccountName | Where-Object {$_.KeyName -eq "key1"} | ForEach-Object{$_.Value}
$storageContainer = "container002"
# 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
# Kafka Rest Proxy configuration info
$kafkaClientGroupName = "yourclientgroupname"
$kafkaClientGroupId = "yourclientgroupid"
$kafkaManagementNodeSize = "Standard_D4_v2"
$disksPerWorkerNode = 2
# Create the cluster
New-AzHDInsightCluster `
-ClusterType Kafka `
-ClusterSizeInNodes 4 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountKey $storageAccountKey `
-StorageContainer $storageContainer `
-SshCredential $clusterCreds `
-KafkaClientGroupId $kafkaClientGroupId -KafkaClientGroupName $kafkaClientGroupName `
-KafkaManagementNodeSize $kafkaManagementNodeSize -DisksPerWorkerNode $disksPerWorkerNode
示例 8:使用 Azure Data Lake Gen2 存储创建 Azure HDInsight 群集。
# Primary storage account info
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageManagedIdentity = "yourstorageusermanagedidentity"
$storageFileSystem = "filesystem01"
$storageAccountType = "AzureDataLakeStorageGen2"
# 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-AzHDInsightCluster `
-ClusterType Hadoop `
-ClusterSizeInNodes 3 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountManagedIdentity $storageManagedIdentity `
-StorageFileSystem $storageFileSystem `
-StorageAccountType $storageAccountType `
-SshCredential $clusterCreds
示例 9:使用企业安全性套餐(ESP)、启用 HDInsight ID 代理和使用 WASB 存储创建 Azure HDInsight 群集。
# Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageAccountKey = "yourstorageaccountaccesskey"
$storageContainer = "yourcontainer01"
# 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
# ESP configuration
$domainResourceId = "your Azure AD Domin Service resource id"
$domainUser = "yourdomainuser"
$domainPassword = ConvertTo-SecureString -String "****" -AsPlainText -Force
$domainCredential = New-Object System.Management.Automation.PSCredential($domainUser, $domainPassword)
$clusterUserGroupDns = "dominusergroup"
$ldapUrls = "ldaps://{your domain name}:636"
$clusterTier = "Premium"
$vnetId = "yourvnetid"
$subnetName = "yoursubnetname"
$assignedIdentity = "your user managed assigned identity resourcee id"
#Create security profile
$config= New-AzHDInsightClusterConfig|Add-AzHDInsightSecurityProfile -DomainResourceId $domainResourceId -DomainUserCredential $domainCredential -LdapsUrls $ldapUrls -ClusterUsersGroupDNs $clusterUserGroupDns
# Create the cluster
New-AzHDInsightCluster `
-ClusterTier $clusterTier `
-ClusterType Hadoop `
-ClusterSizeInNodes 3 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountKey $storageAccountKey `
-StorageContainer $storageContainer `
-SshCredential $clusterCreds `
-VirtualNetworkId $vnetId -SubnetName $subnetName `
-AssignedIdentity $assignedIdentity `
-SecurityProfile $config.SecurityProfile -EnableIDBroker
示例 10:创建启用计算隔离的 Azure HDInsight 群集。
# Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageAccountName = "yourstorageacct001"
$storageAccountKey = Get-AzStorageAccountKey `
-ResourceGroupName $storageAccountResourceGroupName `
-Name $storageAccountName | Where-Object {$_.KeyName -eq "key1"} | ForEach-Object{$_.Value}
$storageContainer = "container002"
# Cluster configuration info
$location = "East US 2"
$clusterResourceGroupName = "Group"
$clusterName = "your-hadoop-002"
$clusterCreds = Get-Credential
$workerNodeSize="Standard_E16S_V3" # here is just an example
$headNodeSize="Standard_E8S_V3"
$zookeeperNodeSize="Standard_E2S_V3"
# If the cluster's resource group doesn't exist yet, run:
# New-AzResourceGroup -Name $clusterResourceGroupName -Location $location
# Create the cluster
New-AzHDInsightCluster `
-ClusterType Hadoop `
-ClusterSizeInNodes 4 `
-WorkerNodeSize $workerNodeSize `
-HeadNodeSize $headNodeSize `
-ZookeeperNodeSize $zookeeperNodeSize `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountKey $storageAccountKey `
-StorageContainer $storageContainer `
-SshCredential $clusterCreds `
-EnableComputeIsolation
示例 11:使用专用链接配置功能创建 Azure HDInsight 群集
# Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageAccountName = "yourstorageacct001"
$storageAccountKey = Get-AzStorageAccountKey `
-ResourceGroupName $storageAccountResourceGroupName `
-Name $storageAccountName | Where-Object {$_.KeyName -eq "key1"} | ForEach-Object{$_.Value}
$storageContainer = "container002"
# 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
# Virtual network info
$virtualNetworkId="yourvnetresourceid"
$subnetName="yoursubnetname"
$ipConfigName="ipconfig"
$privateIPAllocationMethod="dynamic" # the only supported IP allocation method for private link IP configuration is dynamic
$subnetId=$vnetId+"/subnets/"+$subnetName
# Create Private IP configuration
$ipConfiguration= New-AzHDInsightIPConfiguration -Name $ipConfigName -PrivateIPAllocationMethod $privateIPAllocationMethod -SubnetId $subnetId -Primary
$privateLinkConfigurationName="plconfig"
$groupId="headnode"
# Create private link configuration
$privateLinkConfiguration= New-AzHDInsightPrivateLinkConfiguration -Name $privateLinkConfigurationName -GroupId $groupId -IPConfiguration $ipConfiguration
# Create the cluster
New-AzHDInsightCluster `
-ClusterType Hadoop `
-ClusterSizeInNodes 4 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountKey $storageAccountKey `
-StorageContainer $storageContainer `
-SshCredential $clusterCreds `
-VirtualNetworkId $virtualNetworkId -SubnetName $subnetName `
-ResourceProviderConnection Outbound -PrivateLink Enabled -PrivateLinkConfiguration $privateLinkConfiguration
示例 12:创建 Azure HDInsight 群集可用性功能
# Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageAccountName = "yourstorageacct001"
$storageAccountKey = Get-AzStorageAccountKey `
-ResourceGroupName $storageAccountResourceGroupName `
-Name $storageAccountName | Where-Object {$_.KeyName -eq "key1"} | ForEach-Object{$_.Value}
$storageContainer = "container002"
# 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
# Virtual network info
$virtualNetworkId="yourvnetresourceid"
$subnetName="yoursubnetname"
$databaseUserName="yourusername"
$databasePassword=ConvertTo-SecureString -String "****" -AsPlainText -Force
$sqlserverCredential=New-Object System.Management.Automation.PSCredential($databaseUserName, $databasePassword)
$sqlserver="yoursqlserver.database.windows.net"
$ambariDatabase="ambaridb"
$hiveDatabase ="hivedb"
$oozieDatabase = "ooziedb"
# availability zone feature requires customer ambari database, hive metatastore and oozie metastore
# Create Ambari database
$config=New-AzHDInsightClusterConfig|Add-AzHDInsightMetastore `
-SqlAzureServerName $sqlserver -DatabaseName $ambariDatabase `
-Credential $sqlserverCredential -MetastoreType AmbariDatabase
# Create Hive metastore
$config=$config|Add-AzHDInsightMetastore `
-SqlAzureServerName $sqlserver -DatabaseName $hiveDatabase `
-Credential $sqlserverCredential -MetastoreType HiveMetastore
# Create Oozie metastore
$config=$config|Add-AzHDInsightMetastore `
-SqlAzureServerName $sqlserver -DatabaseName $oozieDatabase `
-Credential $sqlserverCredential -MetastoreType OozieMetastore
# availability zones
$zones="1"
# Create the cluster
New-AzHDInsightCluster `
-ClusterType Hadoop `
-ClusterSizeInNodes 4 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountKey $storageAccountKey `
-StorageContainer $storageContainer `
-SshCredential $clusterCreds `
-VirtualNetworkId $virtualNetworkId -SubnetName $subnetName `
-AmbariDatabase $config.AmbariDatabase -HiveMetastore $config.HiveMetastore -OozieMetastore $config.OozieMetastore -Zone $zones
示例 13:使用企业安全性套餐(ESP)和使用 Azure Data Lake Gen2 存储创建 Azure HDInsight 群集。
# Primary storage account info
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageManagedIdentity = "yourstorageusermanagedidentity"
$storageFileSystem = "filesystem01"
$storageAccountType = "AzureDataLakeStorageGen2"
# 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
# ESP configuration
$domainResourceId = "your Azure AD Domin Service resource id"
$domainUser = "yourdomainuser"
$domainPassword = ConvertTo-SecureString -String "****" -AsPlainText -Force
$domainCredential = New-Object System.Management.Automation.PSCredential($domainUser, $domainPassword)
$clusterUserGroupDns = "dominusergroup"
$ldapUrls = "ldaps://{your domain name}:636"
$clusterTier = "Premium"
$vnetId = "yourvnetid"
$subnetName = "yoursubnetname"
$assignedIdentity = "your user managed assigned identity resourcee id"
#Create security profile
$config= New-AzHDInsightClusterConfig|Add-AzHDInsightSecurityProfile -DomainResourceId $domainResourceId -DomainUserCredential $domainCredential -LdapsUrls $ldapUrls -ClusterUsersGroupDNs $clusterUserGroupDns
# Create the cluster
New-AzHDInsightCluster `
-ClusterTier $clusterTier `
-ClusterType Hadoop `
-ClusterSizeInNodes 3 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountManagedIdentity $storageManagedIdentity `
-StorageFileSystem $storageFileSystem `
-StorageAccountType $storageAccountType `
-SshCredential $clusterCreds `
-VirtualNetworkId $vnetId -SubnetName $subnetName `
-AssignedIdentity $assignedIdentity `
-SecurityProfile $config.SecurityProfile
参数
-AadTenantId
指定访问 Azure Data Lake Store 时将使用的 Microsoft Entra 租户 ID。
类型: | Guid |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-AdditionalStorageAccounts
指定群集的其他 Azure 存储帐户。 也可以使用 Add-AzHDInsightStorage cmdlet。
类型: | Dictionary<TKey,TValue>[System.String,System.String] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-AmbariDatabase
获取或设置 ambari 的数据库。
类型: | AzureHDInsightMetastore |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ApplicationId
获取或设置用于访问 Azure Data Lake 的服务主体应用程序 ID。
类型: | Guid |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-AssignedIdentity
获取或设置分配的标识。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-AutoscaleConfiguration
获取或设置自动缩放配置
类型: | AzureHDInsightAutoscale |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-CertificateFileContents
指定访问 Azure Data Lake Store 时将使用的证书的文件内容。
类型: | Byte[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-CertificateFilePath
指定将用于作为服务主体进行身份验证的证书的文件路径。 访问 Azure Data Lake Store 时,群集将使用此群集。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-CertificatePassword
指定将用于作为服务主体进行身份验证的证书的密码。 访问 Azure Data Lake Store 时,群集将使用此群集。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ClusterName
指定群集的名称。
类型: | String |
Position: | 2 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ClusterSizeInNodes
指定群集的工作器节点数。
类型: | Int32 |
Position: | 3 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ClusterTier
指定 HDInsight 群集层。 默认情况下,这是标准。 高级层只能与 Linux 群集一起使用,并使用它来使用一些新功能。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ClusterType
指定要创建的群集的类型。 选项包括:Hadoop、HBase、Storm、Spark、INTERACTIVEHIVE、Kafka 和 RServer
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ComponentVersion
类型: | Dictionary<TKey,TValue>[System.String,System.String] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ComputeIsolationHostSku
获取或设置用于计算隔离的专用主机 SKU。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Config
指定要用于创建群集的群集对象。 可以使用 New-AzHDInsightClusterConfig cmdlet 创建此对象。
类型: | AzureHDInsightConfig |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Configurations
指定此 HDInsight 群集的配置。 也可以使用 Add-AzHDInsightConfigValues cmdlet。
类型: | Dictionary<TKey,TValue>[System.String,System.Collections.Generic.Dictionary`2[System.String,System.String]] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 azure 通信的凭据、帐户、租户和订阅
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DisksPerWorkerNode
指定群集中辅助角色的磁盘数。
类型: | Int32 |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EdgeNodeSize
指定边缘节点的虚拟机大小。 对可接受的 VM 大小使用 Get-AzVMSize,并查看 HDInsight 的定价页。 此参数仅适用于 RServer 群集。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EnableComputeIsolation
启用 HDInsight 计算隔离功能。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EnableIDBroker
启用 HDInsight Identity Broker 功能。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EnableSecureChannel
启用安全通道,它是一个可选字段。
类型: | Nullable<T>[Boolean] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EncryptionAlgorithm
获取或设置加密算法。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EncryptionAtHost
获取或设置指示是否在主机上启用加密的标志。
类型: | Nullable<T>[Boolean] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EncryptionInTransit
获取或设置指示是否在传输中启用加密的标志。
类型: | Nullable<T>[Boolean] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EncryptionKeyName
获取或设置加密密钥名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EncryptionKeyVersion
获取或设置加密密钥版本。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EncryptionVaultUri
获取或设置加密保管库 URI。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-HeadNodeSize
指定头节点的虚拟机大小。 对可接受的 VM 大小使用 Get-AzVMSize,并查看 HDInsight 的定价页。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-HiveMetastore
指定要存储 Hive 元数据的 SQL 数据库。 也可以使用 Add-AzHDInsightMetastore cmdlet。
类型: | AzureHDInsightMetastore |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-HttpCredential
指定群集的群集登录名 (HTTP) 凭据。
类型: | PSCredential |
Position: | 4 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-KafkaClientGroupId
获取或设置 Kafka Rest 代理访问的客户端组 ID。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-KafkaClientGroupName
获取或设置 Kafka Rest 代理访问的客户端组名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-KafkaManagementNodeSize
获取或设置 Kafka 管理节点的大小。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Location
指定群集的位置。
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-MinSupportedTlsVersion
获取或设置受支持的最低 TLS 版本。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ObjectId
指定表示群集的 Microsoft Entra 服务主体的 Microsoft Entra 对象 ID(GUID)。 访问 Azure Data Lake Store 时,群集将使用此群集。
类型: | Guid |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-OozieMetastore
指定要存储 Oozie 元数据的 SQL 数据库。 也可以使用 Add-AzHDInsightMetastore cmdlet。
类型: | AzureHDInsightMetastore |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-OSType
指定群集的操作系统。 选项包括:Windows、Linux
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-OutboundDependenciesManagedType
一个值,用于描述如何管理 HDInsight 群集的出站依赖项。 “Managed”表示出站依赖项由 HDInsight 服务管理。 “外部”表示出站依赖项由客户特定的解决方案管理。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-PrivateLink
获取或设置专用链接类型。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-PrivateLinkConfiguration
获取或设置专用链接配置。
类型: | AzureHDInsightPrivateLinkConfiguration[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-PublicIpTag
获取或设置与公共 IP 关联的 IpTag 的值。 HDInsight、SQL、存储等示例
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-PublicIpTagType
获取或设置 ipTag 类型:示例 FirstPartyUsage。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
指定资源组的名称。
类型: | String |
Position: | 1 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ResourceProviderConnection
获取或设置资源提供程序连接类型。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ScriptActions
指定要在群集创建结束时在群集上运行的脚本操作。 也可以使用 Add-AzHDInsightScriptAction。
类型: | Dictionary<TKey,TValue>[Microsoft.Azure.Management.HDInsight.Models.ClusterNodeType,System.Collections.Generic.List`1[AzureHDInsightScriptAction]] |
接受的值: | HeadNode, WorkerNode, ZookeeperNode, EdgeNode |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-SecurityProfile
指定用于创建安全群集的安全相关属性。 也可以使用 Add-AzHDInsightSecurityProfile cmdlet。
类型: | AzureHDInsightSecurityProfile |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-SshCredential
指定要用于 SSH 连接的 SSH 凭据。 这仅适用于 Linux 群集。
类型: | PSCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-SshPublicKey
指定要用于 SSH 连接的公钥。 这仅适用于 Linux 群集。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-StorageAccountKey
获取或设置存储帐户的存储帐户访问密钥。
类型: | String |
Position: | 6 |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-StorageAccountManagedIdentity
获取或设置存储帐户托管标识。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-StorageAccountResourceId
获取或设置存储帐户的存储资源 ID。
类型: | String |
Position: | 5 |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-StorageAccountType
获取或设置存储帐户的类型。
类型: | Nullable<T>[StorageType] |
接受的值: | AzureStorage, AzureDataLakeStore, AzureDataLakeStorageGen2 |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-StorageContainer
获取或设置默认 Azure 存储帐户的 StorageContainer 名称
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-StorageFileSystem
获取或设置默认 Azure Data Lake Storage Gen2 帐户的文件系统。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-StorageRootPath
获取或设置默认 Data Lake Store 帐户中群集根路径。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-SubnetName
获取或设置此 HDInsight 群集的子网名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Tag
获取或设置群集标记。
类型: | Dictionary<TKey,TValue>[System.String,System.String] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Version
指定 HDInsight 群集的 HDI 版本。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-VirtualNetworkId
指定要在其中预配群集的虚拟网络的 ID。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-WorkerNodeSize
指定工作器节点的虚拟机大小。 对可接受的 VM 大小使用 Get-AzVMSize,并查看 HDInsight 的定价页。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Zone
获取或设置可用性区域。
类型: | String[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ZookeeperNodeSize
指定 Zookeeper 节点的虚拟机大小。 对可接受的 VM 大小使用 Get-AzVMSize,并查看 HDInsight 的定价页。 此参数仅适用于 HBase 或 Storm 群集。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
输入
输出
备注
关键字:azure, azurerm, arm, 资源, 管理, 经理, hadoop, hdinsight, hd, insight