2017-02-22 5 views
0

나는 Azure HDInsight Cluster입니다. Windows Powershell ISE을 통해 하이브 스크립트를 실행하고 싶습니다.Powershell에서 Hive를 실행하는 동안 "이 cmdlet을 호출하기 전에 유효한 Azure HDInsight 클러스터에 연결하십시오."

Powershell에서 다음 스크립트를 실행하는 동안 다음 오류가 발생합니다.

스크립트 :

$clusterName = "utsavdawncluster" 
Use-AzureRmHDInsightCluster $clusterName 
Invoke-Hive -Query "show tables;" 

오류 :

enter image description here

내 파워 쉘 버전과 같다은 다음과 같습니다

enter image description here

,

클러스터 이름이 정확하고 클러스터가 실행 중이어야합니다.

여기서 잘못된 점을 이해할 수 없습니다. 아무도 문제를 말해 줄 수 있습니까?

답변

0

I을 참조 가 사용-AzureRmHDInsightCluster -ClusterName $는 clusterName -HttpCredential $가 전체 샘플의 경우

를 creds 사용하는 클러스터를 설정 문제를 해결했습니다.

이것은 현재 사용중인 쿼리 스크립트로 잘 작동합니다!

$clusterName = "utsavdawncluster" 
$creds=Get-Credential -Message "Enter the login for the cluster" 
Use-AzureRmHDInsightCluster $clusterName -HttpCredential $creds 
$queryString = "show tables;" 
Invoke-AzureRmHDInsightHiveJob -Query $queryString 

이전에 작동하지 않는 유일한 이유는 Invoke-Hive 명령입니다. 이제 Invoke-AzureRmHDInsightHiveJob을 사용하고 있으며 정상적으로 작동합니다.