다음을 통해 공유


Add-AzHDInsightMetastore

클러스터 구성 개체에 Hive 또는 Oozie 메타스토어 역할을 하는 SQL Database를 추가합니다.

구문

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

Description

Add-AzHDInsightMetastore cmdlet은 New-AzHDInsightClusterConfig cmdlet에서 만든 HDInsight 구성 개체에 Hive 또는 Oozie 메타스토어를 추가합니다. 메타스토어는 Hive, Oozie 또는 둘 다에 대한 메타데이터를 저장하는 데 사용할 수 있는 SQL Database입니다.

예제

예제 1: 클러스터 구성 개체에 SQL Database 메타스토어 추가

# 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

이 명령은 hadoop-001이라는 클러스터에 SQL 데이터베이스 메타스토어를 추가합니다.

예제 2: 클러스터 구성 개체에 사용자 지정 Ambari 데이터베이스 추가

# 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

이 명령은 hadoop-002라는 클러스터에 사용자 지정 Ambari 데이터베이스를 추가합니다.

매개 변수

-Config

이 cmdlet에서 수정하는 HDInsight 클러스터 구성 개체를 지정합니다. 이 개체는 New-AzHDInsightClusterConfig cmdlet에 의해 만들어집니다.

형식:AzureHDInsightConfig
Position:0
Default value:None
필수:True
파이프라인 입력 허용:True
와일드카드 문자 허용:False

-Credential

AzureSQL 서버 데이터베이스에 사용할 자격 증명을 지정합니다.

형식:PSCredential
Position:4
Default value:None
필수:True
파이프라인 입력 허용:False
와일드카드 문자 허용:False

-DatabaseName

이 메타스토어에 사용할 AzureSQL 서버 인스턴스의 데이터베이스를 지정합니다.

형식:String
Position:3
Default value:None
필수:True
파이프라인 입력 허용:False
와일드카드 문자 허용:False

-DefaultProfile

Azure와의 통신에 사용되는 자격 증명, 계정, 테넌트 및 구독

형식:IAzureContextContainer
별칭:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
필수:False
파이프라인 입력 허용:False
와일드카드 문자 허용:False

-MetastoreType

메타스토어의 형식을 지정합니다. 가능한 값은 HiveMetastore 또는 OozieMetastore입니다.

형식:AzureHDInsightMetastoreType
허용되는 값:HiveMetastore, OozieMetastore, AmbariDatabase
Position:1
Default value:None
필수:True
파이프라인 입력 허용:False
와일드카드 문자 허용:False

-SqlAzureServerName

이 메타스토어에 사용할 AzureSQL 서버 인스턴스를 지정합니다.

형식:String
Position:2
Default value:None
필수:True
파이프라인 입력 허용:False
와일드카드 문자 허용:False

입력

출력