如何使用powershell通过配置单元元存储创建azure hdinsight群集?

dxxyhpgq  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(405)

我试图用hive元存储创建hdinsight集群。已成功创建群集,但没有配置单元元存储。也没有返回任何错误。我使用了下面的powershell脚本。

$resourceGroupName = "ResourceGroup"
$storageAccountName = "myStorage"
$containerName="myContainer"

$clusterName = "myCluster"
$location = "West Europe"
$clusterNodes = 2
$clusterType = "Hadoop"
$OSType = "Windows"
$hdVersion = "3.2"

$hadoopUserName = "user"
$hadoopUserPassword = "password"
$hadoopUserPW = ConvertTo-SecureString -String $hadoopUserPassword -AsPlainText -Force
$clusterCreds = New-Object System.Management.Automation.PSCredential($hadoopUserName,$hadoopUserPW)

$sqlDatabaseServerName = "mydbserver"
$metaStoreDBName = "HiveMetaStoreDB"
$sqlDatabaseLogin = "myDBLogin"
$sqlDatabasePassword = "myDBPassword"
$sqlDatabaseSecurePassword = ConvertTo-SecureString -String $sqlDatabasePassword -AsPlainText -Force
$sqlServerCred = New-Object System.Management.Automation.PSCredential ($sqlDatabaseLogin, $sqlDatabaseSecurePassword)

# Create a new HDInsight cluster

    $config = New-AzureRmHDInsightClusterConfig -ClusterType Hadoop `
        | Add-AzureRmHDInsightMetastore `
            -SqlAzureServerName "$sqlDatabaseServerName.database.windows.net" `
            -DatabaseName $metaStoreDBName `
            -Credential $sqlServerCred `
            -MetastoreType HiveMetastore 

$config.DefaultStorageAccountName = "$storageAccountName.blob.core.windows.net"
$config.DefaultStorageAccountKey = $storageAccountKey           

New-AzureRmHDInsightCluster `
        -config $config `
        -OSType $OSType `
        -clustername $clusterName `
        -HttpCredential $clusterCreds `
        -DefaultStorageContainer $containerName `
        -Location $location `
        -ResourceGroupName $resourceGroupName `
        -ClusterSizeInNodes $clusterNodes `
        -Version $hdVersion

有人能告诉我为什么没有创建Hive元存储吗?或者我该怎么做才能创造它?

xvw2m8pv

xvw2m8pv1#

群集创建过程不会为您创建azure数据库。必须先创建数据库,然后才能将其用作配置单元元存储。

相关问题