hadoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Naganarasimha G R (Naga)" <garlanaganarasi...@huawei.com>
Subject RE: Passing Args to Mappers and Reducers
Date Tue, 06 Oct 2015 14:46:03 GMT
Hi Ista,

In general we need to give after specifying the class name like
./yarn jar ../share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-3.0.0-SNAPSHOT.jar
sleep -Dmapreduce.job.queuename=default -m 10 -r 1 -mt 5000

i think in your case it should be
From: Istabrak Abdul-Fatah [ifatah@gmail.com]
Sent: Tuesday, October 06, 2015 19:46
To: user@hadoop.apache.org
Subject: Re: Passing Args to Mappers and Reducers

Hi Shahab,
Thx for the quick reply.
Yes, I am using the tool interface and can run the job successfully.
I need to pass some extra args dynamically as part of the invocation.

I have tried adding a space after the -D option and it did not work either (see below).

~]$ yarn -D ista="666666" jar /opt/yarn/my_examples/AvgSix.jar /user/yarn/input/sample.csv
Error: Could not find or load main class ista=666666

It does not see to recognize the -D option.



On Tue, Oct 6, 2015 at 9:26 AM, Shahab Yunus <shahab.yunus@gmail.com<mailto:shahab.yunus@gmail.com>>
Are you properly implementing the Tool interface?

Also, there needs to be space between -D and the param name.


On Tue, Oct 6, 2015 at 9:22 AM, Istabrak Abdul-Fatah <ifatah@gmail.com<mailto:ifatah@gmail.com>>
Greetings to all,
Is it possible to pass args to Mapper and Reducers via the command line args.
I need to pass some args upon the MapRed job invocation so that I can pass these args via
the Context object to the Mapper and Reducer code.
I am currently running Hadoop2.7 and tried to pass some args using the -D VM args but it did
not succeed.
Here are some failed code snippets:

~]$ yarn -Dista="666666" jar /opt/yarn/my_examples/AvgSix.jar /user/yarn/input/samplefile.csv

~]$ yarn  jar -Dista="666666" /opt/yarn/my_examples/AvgSix.jar /user/yarn/input/samplefile.csv

~]$ yarn  jar /opt/yarn/my_examples/AvgSix.jar /user/yarn/input/samplefile.csv output  -Dista="666666"

Please advise.

Thx and BR


View raw message