2016-05-13 60 views
1

我在Github上關注this guide,我無法運行Step 5中提到的示例mapreduced作業。嘗試使用Tidoop REST API在FIWARE-Cosmos上運行MapReduce作業時出錯

我知道這個文件不再存在:

/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar

而且我知道,同樣的文件,現在可以在這裏找到:

/usr/lib/hadoop-0.20/hadoop-examples-0.20.2-cdh3u6.jar

所以我形成我的請撥打電話:

curl -v -X POST "http://computing.cosmos.lab.fiware.org:12000/tidoop/v1/user/$user/jobs" -d '{"jar":"/usr/lib/hadoop-0.20/hadoop-examples-0.20.2-cdh3u6.jar","class_name":"WordCount","lib_jars":"/usr/lib/hadoop-0.20/hadoop-examples-0.20.2-cdh3u6.jar","input":"testdir","output":"testoutput"}' -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN"

輸入目錄存在於我的hdfs用戶空間中,裏面有一個名爲testdata.txt的文件。 testoutput文件夾不存在於我的hdfs用戶空間中,因爲我知道它會產生問題。

當我執行這個curl命令,我得到的錯誤是{"success":"false","error":1}這是不是很具描述性。有什麼我在這裏失蹤?

回答

1

這與我的用戶frb和用戶的有效令牌處於剛測試:

$ curl -X POST "http://computing.cosmos.lab.fiware.org:12000/tidoop/v1/user/frb/jobs" -d '{"jar":"/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar","class_name":"wordcount","lib_jars":"/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar","input":"testdir","output":"outputtest"}' -H "Content-Type: application/json" -H "X-Auth-Token: xxxxxxxxxxxxxxxxxxx" 
{"success":"true","job_id": "job_1460639183882_0011"} 

請注意,在「新」集羣(computing.cosmos.lab MapReduce的例子脂肪罐子。 fiware.org)在/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar,詳見文檔。 /usr/lib/hadoop-0.20/hadoop-examples-0.20.2-cdh3u6.jar是「舊」羣集中的胖罐(cosmos.lab.fiware.org)。

EDIT 1

最後,用戶在「新的」一對在FIWARE LAB宇宙的簇(storage.cosmos.lab.fiware.orgcomputing.cosmos.lab.fiware.org),其中Tidoop運行的沒有帳戶,但在另一個「老」簇( cosmos.lab.fiwre.org)。因此,只需在「新」賬戶中提供賬戶即可解決問題。

+0

謝謝您的回覆。即使我在curl命令中將路徑更改爲jar文件,我也會得到相同的響應'{「success」:「false」,「error」:1}'。我們的curl命令之間的唯一區別是用戶名和令牌。該令牌是有效的,因爲我可以列出,創建,刪除文件和文件夾。可能這與用戶權限有關,或者是一個長鏡頭,但是,我的用戶名? – McMutton

+0

稍等片刻......您在新羣集中沒有帳戶! :)我已經看到你有一箇舊帳戶('cosmos.lab.fiware.org'),但沒有在新帳戶(實際上,它是一對集羣,'storage.cosmos.lab。 fiware.org'和'computing.cosmos.lab.fiware.org')。請閱讀QSG第2部分的新羣集(您鏈接的羣集),以便在新羣集中獲得帳戶。 – frb

+0

順便說一句,Tidoop只在新的一對羣集中可用。 – frb