gpt4 book ai didi

hadoop - 从 SSH 中直接调用 Hadoop 启 Action 业

转载 作者:可可西里 更新时间:2023-11-01 16:34:43 26 4
gpt4 key购买 nike

我已经能够很好地使用 elastic-mapreduce ruby​​ 库启动工作流程。现在我有一个实例在它的工作完成后仍然“活着”。我已经使用 SSH 登录并想开始另一项工作,但是我的各种尝试都失败了,因为 hadoop 找不到输入文件。我试过将输入文件存储在本地和 S3 上。

如何直接从我的 SSH session 中创建新的 hadoop 作业?

我尝试的错误:

(第一次尝试使用本地文件存储,这是我通过使用 SFTP 上传文件创建的)

hadoop jar hadoop-0.20-streaming.jar \
-input /home/hadoop/mystic/search_sets/test_sample.txt \
-output /home/hadoop/mystic/search_sets/test_sample_output.txt \
-mapper /home/hadoop/mystic/ctmp1_mapper.py \
-reducer /home/hadoop/mystic/ctmp1_reducer.py \
-file /home/hadoop/mystic/ctmp1_mapper.py \
-file /home/hadoop/mystic/ctmp1_reducer.py

11/10/04 22:33:57 ERROR streaming.StreamJob: Error Launching job :Input path does not exist: hdfs://ip-xx-xxx-xxx-xxx.us-west-1.compute.internal:9000/home/hadoop/mystic/search_sets/test_sample.txt

(第二次尝试使用 s3):

hadoop jar hadoop-0.20-streaming.jar \
-input s3n://xxxbucket1/test_sample.txt \
-output /home/hadoop/mystic/search_sets/test_sample_output.txt \
-mapper /home/hadoop/mystic/ctmp1_mapper.py \
-reducer /home/hadoop/mystic/ctmp1_reducer.py \
-file /home/hadoop/mystic/ctmp1_mapper.py \
-file /home/hadoop/mystic/ctmp1_reducer.py

11/10/04 22:26:45 ERROR streaming.StreamJob: Error Launching job : Input path does not exist: s3n://xxxbucket1/test_sample.txt

最佳答案

第一个不行。 Hadoop 将在 HDFS 中查找该位置,而不是本地存储。如果您使用 file:// 前缀,它可能会起作用,如下所示:

-input file:///home/hadoop/mystic/search_sets/test_sample.txt

不过,我从来没有尝试过使用流输入,即使它确实有效,它也可能不是最好的主意。

第二个 (S3) 应该可以工作。我们一直这样做。确保文件确实存在:

hadoop dfs -ls s3n://xxxbucket1/test_sample.txt

或者,您可以将文件放在 HDFS 中并正常使用。不过,对于 EMR 中的作业,我通常发现 S3 是最方便的。

关于hadoop - 从 SSH 中直接调用 Hadoop 启 Action 业,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7655056/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com