Ошибка при запуске рекомендаций фильмов с помощью Apache Mahout с HDInsight

Я выполнил следующий код, но получил сообщение об ошибке...

# The HDInsight cluster name.
$clusterName = "my-cluster-name"

Use-AzureHDInsightCluster $clusterName

# 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")}
$mahoutPath = $mahoutPath -replace "\\", "/"
$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:///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

Я загрузил файл u.data с помощью Azure Storage Explorer в корень контейнера, который содержит файлы hdinsight.

Я получаю ошибку в строке ..

PS C:> $job = Start-AzureHDInsightJob -Cluster $clusterName -JobDefinition $jobDefinition

Ошибка:

Start-AzureHDInsightJob: Ошибка запроса с кодом:InternalServerError Content:{"error":null} В строке:1 char:8 + $job = Start-AzureHDInsightJob -Cluster $clusterName -JobDefinition $jobDefiniti ... + ~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Start-AzureHDInsightJob], HttpLayerException + FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.HDInsight.Framework.Core.Library. WebRequest.HttpLayerException,Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.PSCmdlets.StartAzureHDInsightJobCmdlet

Любая помощь искренне приветствуется.

Спасибо


person Arnab    schedule 05.04.2015    source источник


Ответы (1)


Это похоже на недавнее изменение Hive/Templeton в кластере HDInsight, где теперь он возвращает CRLF в конце пути к файлу. Я изменил сценарий на следующий, чтобы исправить это:

$mahoutPath = Invoke-Hive -Query '!${env:COMSPEC} /c dir /b /s ${env:MAHOUT_HOME}\examples\target\*-job.jar' | where {$_.startswith("C:\apps\dist")}
$noCRLF = $mahoutPath -replace "`r`n", ""
$cleanedPath = $noCRLF -replace "\\", "/"
$jarFile = "file:///$cleanedPath"
person Larry Franks    schedule 06.04.2015