Setup and Run Oozie Examples

To get familiar with Oozie, set up and try the examples.
  1. Complete the following steps to set up the examples and copy them to the cluster:
    1. Extract the oozie examples archive oozie-examples.tar.gz:
      cd /opt/mapr/oozie/oozie-<version>
      tar xvfz ./oozie-examples.tar.gz -C /opt/mapr/oozie/oozie-<version>/
    2. Copy the examples to MapR-FS. Run the following command as a user that has permissions to write to the specified MapR-FS directory:
      hadoop fs -put examples maprfs:///user/<user_name>/examples
    3. Copy the input data to MapR-FS. Run the following command as a user that has permissions to write to the specified MapR-FS directory:
      hadoop fs -put examples/input-data maprfs:///user/<user_name>/input-data
    4. Change permissions on the examples to make them accessible to all users. Run the following command as the root user, using sudo, or as the owner of the specified directory:
      hadoop fs -chmod -R 777 maprfs:///user/<user_name>/examples
  2. Complete the following steps to run the examples:
    1. Choose an example and run it with the oozie job command. For example, you can use the following commands to run the following examples:
      • MapReduce
        /opt/mapr/oozie/oozie-<version>/bin/oozie job -oozie="http://localhost:11000/oozie" -config /opt/mapr/oozie/oozie-<version>/examples/apps/map-reduce/job.properties -run
      • Spark (available with Oozie 4.1.0 or greater)
        /opt/mapr/oozie/oozie-<version>/bin/oozie job -oozie="http://localhost:11000/oozie" -config /opt/mapr/oozie/oozie-<version>/examples/apps/spark/job.properties -run
      • Hiveserver2 (available with Oozie 4.2.0 or greater):
        /opt/mapr/oozie/oozie-<version>/bin/oozie job -oozie="http://localhost:11000/oozie" -config /opt/mapr/oozie/oozie-<version>/examples/apps/hive2/job.properties -run
      Note: To run the packaged Hive examples, make /tmp on MapR-FS world-writable. Set /tmp to 777. Example:
      hadoop fs -chmod -R 777 /tmp
      If /tmp does not exist, create /tmp and then set it to 777.