尝试使用Tidoop REST API在FIWARE-Cosmos上运行MapReduce作业时出错

时间:2016-05-13 13:39:04

标签: fiware fiware-cosmos

我在Github上关注this guide,我无法运行Step 5中提到的示例mapreduced作业。

我知道此文件已不存在:

/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的文件。 testdput文件夹在我的hdfs用户空间中不存在,因为我知道它会产生问题。

当我执行此curl命令时,我得到的错误是{"success":"false","error":1},这不是很具描述性。我在这里缺少什么吗?

1 个答案:

答案 0 :(得分: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"}

请使用" new"中的MapReduce示例观察胖罐。 cluster(computing.cosmos.lab.fiware.org)位于/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar,详见文档。 /usr/lib/hadoop-0.20/hadoop-examples-0.20.2-cdh3u6.jar是" old"中的胖罐子。 cluster(cosmos.lab.fiware.org)。

编辑1

最后,用户在" new"中没有帐号。在FIOTARE LAB(storage.cosmos.lab.fiware.orgcomputing.cosmos.lab.fiware.org)中的一对宇宙群,Tidoop在那里运行,但在另一个" old"集群(cosmos.lab.fiwre.org)。因此,通过简单地在" new"中设置帐户来解决该问题。的。