Udostępnij za pośrednictwem


Add-AzHDInsightMetastore

Dodaje bazę danych SQL Database do obsługi jako magazyn metadanych Hive lub Oozie do obiektu konfiguracji klastra.

Składnia

Add-AzHDInsightMetastore
   [-Config] <AzureHDInsightConfig>
   [-MetastoreType] <AzureHDInsightMetastoreType>
   [-SqlAzureServerName] <String>
   [-DatabaseName] <String>
   [-Credential] <PSCredential>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Opis

Polecenie cmdlet Add-AzHDInsightMetastore dodaje magazyn metadanych Hive lub Oozie do obiektu konfiguracji usługi HDInsight utworzonego przez polecenie cmdlet New-AzHDInsightClusterConfig. Magazyn metadanych to baza danych SQL, która może służyć do przechowywania metadanych dla programów Hive, Oozie lub obu tych typów.

Przykłady

Przykład 1. Dodawanie magazynu metadanych bazy danych SQL do obiektu konfiguracji klastra

# 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

To polecenie dodaje magazyn metadanych bazy danych SQL do klastra o nazwie your-hadoop-001.

Przykład 2. Dodawanie niestandardowej bazy danych Ambari do obiektu konfiguracji klastra

# 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

To polecenie dodaje niestandardową bazę danych Ambari do klastra o nazwie your-hadoop-002.

Parametry

-Config

Określa obiekt konfiguracji klastra usługi HDInsight, który modyfikuje to polecenie cmdlet. Ten obiekt jest tworzony przez polecenie cmdlet New-AzHDInsightClusterConfig.

Typ:AzureHDInsightConfig
Position:0
Domyślna wartość:None
Wymagane:True
Akceptowanie danych wejściowych potoku:True
Akceptowanie symboli wieloznacznych:False

-Credential

Określa poświadczenia do użycia dla bazy danych programu AzureSQL Server.

Typ:PSCredential
Position:4
Domyślna wartość:None
Wymagane:True
Akceptowanie danych wejściowych potoku:False
Akceptowanie symboli wieloznacznych:False

-DatabaseName

Określa bazę danych w wystąpieniu serwera AzureSQL do użycia dla tego magazynu metadanych.

Typ:String
Position:3
Domyślna wartość:None
Wymagane:True
Akceptowanie danych wejściowych potoku:False
Akceptowanie symboli wieloznacznych:False

-DefaultProfile

Poświadczenia, konto, dzierżawa i subskrypcja używane do komunikacji z platformą Azure

Typ:IAzureContextContainer
Aliasy:AzContext, AzureRmContext, AzureCredential
Position:Named
Domyślna wartość:None
Wymagane:False
Akceptowanie danych wejściowych potoku:False
Akceptowanie symboli wieloznacznych:False

-MetastoreType

Określa typ magazynu metadanych. Możliwe wartości to HiveMetastore lub OozieMetastore.

Typ:AzureHDInsightMetastoreType
Dopuszczalne wartości:HiveMetastore, OozieMetastore, AmbariDatabase
Position:1
Domyślna wartość:None
Wymagane:True
Akceptowanie danych wejściowych potoku:False
Akceptowanie symboli wieloznacznych:False

-SqlAzureServerName

Określa wystąpienie serwera AzureSQL, które ma być używane dla tego magazynu metadanych.

Typ:String
Position:2
Domyślna wartość:None
Wymagane:True
Akceptowanie danych wejściowych potoku:False
Akceptowanie symboli wieloznacznych:False

Dane wejściowe

AzureHDInsightConfig

Dane wyjściowe

AzureHDInsightConfig