2014-10-15 6 views
0

MS Azure를 처음 사용했습니다.하늘색 동영상 추천 예제를 실행할 수없는 이유는 무엇입니까?

영화 추천 사례를 실행하는 것에 대해 질문이 있습니다. PowerShell을 이미 설치 했으므로 hdInsight의 버전은 3.1이고, 뒤에 나는 the tutorial입니다.

# Create the job definition 
$jobDefinition = New-AzureHDInsightMapReduceJobDefinition ` 
    -JarFile $jarFile ` 
    -ClassName "org.apache.mahout.cf.taste.hadoop.item.RecommenderJob" ` 
    -Arguments $jobArguments 

오류가 jarfile가에 관한 것입니다 : 는하지만 다음 코드를 할 수 없습니다.

New-AzureHDInsightMapReduceJobDefinition : 無法將 'System.Object[]' 轉換為 'JarFile' 參數所需的 'System.String' 型別。不支援指定的方法。 
位於 線路:2 字元:12 
+ -JarFile $jarFile ` 
+   ~~~~~~~~ 
    + CategoryInfo   : InvalidArgument: (:) [New-AzureHDInsightMapReduceJobDefinition],ParameterBindingException 
    + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.PSCmdlets.NewAzureHDIn 
    sightMapReduceDefinitionCmdlet 

는 사람이 해결에 대한 아이디어가 있습니까 : 여기

오류인가?

답변

0

클러스터의 Mahout 버전이 최근에 업데이트되어 예제 코드의 하드 코딩 된 경로가 잘못되었습니다.

$jarFile = "file:///c:/apps/dist/mahout-0.9.0.2.1.3.0-1887/examples/target/mahout-examples-0.9.0.2.1.3.0-1887-job.jar"

$jarFile = "file:///c:/apps/dist/mahout-0.9.0.2.1.6.0-2103/examples/target/mahout-examples-0.9.0.2.1.6.0-2103-job.jar"

에 오늘 비전 클러스터에서 경로입니다 :

는 읽는 PowerShell 스크립트에서 줄을 변경,이 문제를 해결합니다. 잠시 동안 프로비저닝 한 클러스터가있는 경우 원격 데스크톱을 활성화하고 클러스터에 연결 한 다음 c : \ apps \ dist \로 이동하여 Mahout의 현재 버전을 볼 수 있습니다.

EDIT : 하이브를 사용하여 mahout jar 이름을 동적으로 가져 오는 수정 된 스크립트가 있습니다.

# The HDInsight cluster name. 
$clusterName = "the cluster name" 

# NOTE: The version number portion of the file path 
# may change in future versions of HDInsight. 
# So dynamically grab it using Hive. 
$mahoutPath = Invoke-Hive -Query '!${env:COMSPEC} /c dir /b /s ${env:MAHOUT_HOME}\examples\target\*-job.jar' | where {$_.startswith("C:\apps\dist")} 
$jarFile = "file:///$mahoutPath" 
# 
# If you are using an earlier version of HDInsight, 
# set $jarFile to the jar file you 
# uploaded. 
# For example, 
# $jarFile = "wasb:///example/jars/mahout-core-0.9-job.jar" 

# The arguments for this job 
# * input - the path to the data uploaded to HDInsight 
# * output - the path to store output data 
# * tempDir - the directory for temp files 
$jobArguments = "-s", "SIMILARITY_COOCCURRENCE", 
       "--input", "wasb:///example/data/u.data", 
       "--output", "wasb:///example/out", 
       "--tempDir", "wasb:///temp/mahout" 

# Create the job definition 
$jobDefinition = New-AzureHDInsightMapReduceJobDefinition ` 
    -JarFile $jarFile ` 
    -ClassName "org.apache.mahout.cf.taste.hadoop.item.RecommenderJob" ` 
    -Arguments $jobArguments 

# Start the job 
$job = Start-AzureHDInsightJob -Cluster $clusterName -JobDefinition $jobDefinition 

# Wait on the job to complete 
Write-Host "Wait for the job to complete ..." -ForegroundColor Green 
Wait-AzureHDInsightJob -Job $job 

# Write out any error information 
Write-Host "STDERR" 
Get-AzureHDInsightJobOutput -Cluster $clusterName -JobId $job.JobId -StandardError 
+0

답장을 보내 주셔서 감사합니다. 나는 그것을 시도 할 것이다! – KST

+0

@Larry Franks 확인해주세요. http://stackoverflow.com/questions/29454864/error-in-running-movie-recommendations-by-using-apache-mahout-with-hdinsight 감사합니다 .. – Arnab