MapR 5.0 Documentation : Your First Hadoop Job

Now that MapR is installed, you can use Hadoop normally. Let's try a few simple Hadoop commands you probably already know: accessing data with the hadoop fs command, then running a simple example MapReduce job.

Example: Hadoop FileSystem Shell

Try a few Hadoop FileSystem commands:

  1. List the contents of the root directory by typing hadoop fs -ls /
  2. Create a directory called foo by typing hadoop fs -mkdir /foo
  3. List the root directory again to verify that /foo is there: hadoop fs -ls /

Example:

# hadoop fs -ls
Found 3 items
drwxr-xr-x   - pconrad supergroup          0 2011-01-03 13:50 /foo
drwxr-xr-x   - pconrad supergroup          0 2011-01-04 13:57 /user
drwxr-xr-x   - mapred supergroup           0 2010-11-25 09:41 /var

Example: MapReduce

The following example performs a MapReduce job to estimate the value of Pi using 2 map tasks, each of which computes 50 samples:

# hadoop jar /opt/mapr/hadoop/hadoop-0.20.2/hadoop-0.20.2-dev-examples.jar pi 2 50

By the way, the directory you created in the previous example will be useful in the next step.

Next: Mounting a Single-Node Cluster via NFS