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[]>]
[-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[]>]
[-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[]>]
[-PrivateLinkConfiguration <AzureHDInsightPrivateLinkConfiguration[]>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
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 Proxy 建立 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:使用企業安全性套件建立 Azure HDInsight 叢集(ESP),啟用 HDInsight ID Broker 並使用 WASB 記憶體。
# 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:使用 Enterprise Security Package(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 租使用者標識符。
類型: | 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 的服務主體應用程式識別碼。
類型: | 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 Proxy 存取的用戶端群組識別碼。
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-KafkaClientGroupName
取得或設定 Kafka Rest Proxy 存取的用戶端組名。
類型: | 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 物件識別碼(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 叢集的輸出相依性。 「受控」表示輸出相依性是由 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
取得或設定記憶體帳戶的記憶體資源標識碼。
類型: | 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 |
-Version
指定 HDInsight 叢集的 HDI 版本。
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-VirtualNetworkId
指定要在其中佈建叢集的虛擬網路標識碼。
類型: | 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、resource、management、manager、hadoop、hdinsight、hd、insight