2015-04-05 4 views
0

Я побежал следующий код, но получает сообщение об ошибке ...Ошибка запуска фильм рекомендации с помощью 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 лазурного проводника хранения в корень контейнер, который содержит файлы hdinsight ..

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

PS C:> $ работа = Запуск AzureHDInsightJob -cluster $ ClusterName -JobDefinition $ jobDefinition

Ошибка:

Start-AzureHDInsightJob: Не удалось выполнить запрос с кодом: InternalServerError Содержание: { "Ошибка": нулевая} В строке: 1 символ: 8 + $ Работа = Запуск AzureHDInsightJob -cluster $ ClusterName - JobDefinition $ jobDefiniti ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo: NotSpecified: (:) [Start-AzureHDInsightJob], HttpLayerException + FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.HDInsight.Framework.Core.Library.WebRequest.HttpLayerE xception, Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.PSCmdlets.StartAzureHDInsightJobCmdlet

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

Благодаря

ответ

0

Это похоже на недавние изменения в любой из улья/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" 
Смежные вопросы