Add-AzHDInsightMetastore
Menambahkan SQL Database untuk berfungsi sebagai metastore Apache Hive atau Oozie ke objek konfigurasi kluster.
Sintaks
Add-AzHDInsightMetastore
[-Config] <AzureHDInsightConfig>
[-MetastoreType] <AzureHDInsightMetastoreType>
[-SqlAzureServerName] <String>
[-DatabaseName] <String>
[-Credential] <PSCredential>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Deskripsi
Cmdlet Add-AzHDInsightMetastore menambahkan metastore Apache Hive atau Oozie ke objek konfigurasi HDInsight yang dibuat oleh cmdlet New-AzHDInsightClusterConfig. Metastore adalah Database SQL yang dapat digunakan untuk menyimpan metadata untuk Apache Hive, Oozie, atau keduanya.
Contoh
Contoh 1: Menambahkan metastore database SQL ke objek konfigurasi kluster
# Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageAccountName = "yourstorageacct001"
$storageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $storageAccountResourceGroupName -Name $storageAccountName)[0].value
$storageContainer = "container001"
# Cluster configuration info
$location = "East US 2"
$clusterResourceGroupName = "Group"
$clusterName = "your-hadoop-001"
$clusterCreds = Get-Credential
# If the cluster's resource group doesn't exist yet, run:
# New-AzResourceGroup -Name $clusterResourceGroupName -Location $location
# Hive metastore info
$hiveSqlServer = "your-sqlserver-001"
$hiveDb = "your-sqldb-001"
$hiveCreds = Get-Credential
# Oozie metastore info
$oozieSqlServer = "your-sqlserver-001"
$oozieDb = "your-sqldb-002"
$oozieCreds = Get-Credential
# Create the cluster
New-AzHDInsightClusterConfig `
| Add-AzHDInsightMetastore `
-SqlAzureServerName "$oozieSqlServer.database.contoso.net" `
-DatabaseName $oozieDb `
-Credential $oozieCreds `
-MetastoreType OozieMetastore `
| Add-AzHDInsightMetastore `
-SqlAzureServerName "$hiveSqlServer.database.contoso.net" `
-DatabaseName $hiveDb `
-Credential $hiveCreds `
-MetastoreType HiveMetastore `
| New-AzHDInsightCluster `
-ClusterType Hadoop `
-OSType Windows `
-ClusterSizeInNodes 4 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountKey $storageAccountKey `
-StorageContainer $storageContainer
Perintah ini menambahkan metastore database SQL ke kluster bernama your-hadoop-001.
Contoh 2: Menambahkan database Ambari kustom ke objek konfigurasi kluster
# Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageAccountName = "yourstorageacct001"
$storageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $storageAccountResourceGroupName -Name $storageAccountName)[0].value
$storageContainer = "container001"
# 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
# Custom Amari database info
$ambariSqlServer = "your-sqlserver-001"
$ambariDb = "your-sqldb-003"
$ambariCreds = Get-Credential
# Create the cluster
New-AzHDInsightClusterConfig `
| Add-AzHDInsightMetastore `
-SqlAzureServerName "$ambariSqlServer.database.contoso.net" `
-DatabaseName $ambariDb `
-Credential $ambariCreds `
-MetastoreType AmbariDatabase `
| New-AzHDInsightCluster `
-ClusterType Hadoop `
-OSType Windows `
-ClusterSizeInNodes 4 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountKey $storageAccountKey `
-StorageContainer $storageContainer
Perintah ini menambahkan database Ambari kustom ke kluster bernama your-hadoop-002.
Parameter
-Config
Menentukan objek konfigurasi kluster HDInsight yang dimodifikasi cmdlet ini. Objek ini dibuat oleh cmdlet New-AzHDInsightClusterConfig .
Type: | AzureHDInsightConfig |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Credential
Menentukan kredensial yang akan digunakan untuk database AzureSQL Server.
Type: | PSCredential |
Position: | 4 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DatabaseName
Menentukan database pada instans AzureSQL Server yang akan digunakan untuk metastore ini.
Type: | String |
Position: | 3 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
Kredensial, akun, penyewa, dan langganan yang digunakan untuk komunikasi dengan azure
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MetastoreType
Menentukan jenis metastore. Nilai yang mungkin adalah HiveMetastore atau OozieMetastore.
Type: | AzureHDInsightMetastoreType |
Accepted values: | HiveMetastore, OozieMetastore, AmbariDatabase |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SqlAzureServerName
Menentukan instans AzureSQL Server yang akan digunakan untuk metastore ini.
Type: | String |
Position: | 2 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Input
Output
Link Terkait
Azure PowerShell
Saran dan Komentar
https://aka.ms/ContentUserFeedback.
Segera hadir: Sepanjang tahun 2024 kami akan menghentikan penggunaan GitHub Issues sebagai mekanisme umpan balik untuk konten dan menggantinya dengan sistem umpan balik baru. Untuk mengetahui informasi selengkapnya, lihat:Kirim dan lihat umpan balik untuk