Commands to Run MapReduce Job

ant build your mapreduce job jar first. See the following ant build.xml

<project name=”MyProject” basedir=”.” default=”distr”>

<property name=”Name” value=”TSMapReduce”/>

<property name=”name” value=”TSMapReduce”/>


<property name=”version” value=”0.1.0″/>

<property name=”” value=”${name}-${version}”/>


<property name=”src.dir” value=”src”/>

    <property name=”lib.dir” value=”lib”/>


<property name=”build.dir” value=”build”/>

<property name=”jar.dir” value=”${build.dir}”/>

<property name=”build.lib.dir” value=”${build.dir}/lib”/>


<property name=”main-class” value=”com.your_xxx_domain.timeseries.MyMapReduceJob”/>

<property name=”tmp.dir” value=”tmp”/>

    <path id=”classpath”>

        <fileset dir=”${lib.dir}” includes=”**/*.jar”/>



<target name=”clean”>

<delete dir=”${build.dir}”/>

<delete dir=”${tmp.dir}”/>



<target name=”compile”>

<mkdir dir=”${tmp.dir}”/>

<mkdir dir=”${build.dir}”/>


<javac srcdir=”${src.dir}” destdir=”${tmp.dir}” debug=”on”




<target name=”distr” depends=”jar”>

<mkdir dir=”${build.lib.dir}”/>

<copy todir=”${build.lib.dir}”>

<fileset dir=”${lib.dir}”/>



<delete dir=”${tmp.dir}”/>



<target name=”jar” depends=”clean, compile”>


<jar destfile=”${build.dir}/${}.jar” basedir=”${tmp.dir}”>

<!– <manifest>

<attribute name=”Main-Class” value=”${main-class}”/>

<attribute name=”Class-Path” value=”classpath”/>



<fileset dir=”.”>

<include name=”**/${lib.dir}/**” />






./bin/hadoop jar YOUR_MAP_REDUCE_JOB.jar programArgs1 programArgs2

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s