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 file system. Run the following command as a user that has permissions to write to the specified MapR file system directory:
      hadoop fs -put examples maprfs:///user/<user_name>/examples
    3. Copy the input data to MapR file system. Run the following command as a user that has permissions to write to the specified MapR file system 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. You can use the following commands to run the following examples. The <oozie_port_number> depends on whether your cluster is secure.
      • MapReduce
        /opt/mapr/oozie/oozie-<version>/bin/oozie job -oozie="http://localhost:<oozie_port_number>/oozie" -config /opt/mapr/oozie/oozie-<version>/examples/apps/map-reduce/job.properties -run
      • Spark
        /opt/mapr/oozie/oozie-<version>/bin/oozie job -oozie="http://localhost:<oozie_port_number>/oozie" -config /opt/mapr/oozie/oozie-<version>/examples/apps/spark/job.properties -run
      • Hiveserver2
        /opt/mapr/oozie/oozie-<version>/bin/oozie job -oozie="http://localhost:<oozie_port_number>/oozie" -config /opt/mapr/oozie/oozie-<version>/examples/apps/hive2/job.properties -run
      Note: To run the packaged Hive examples, make /tmp on MapR file system 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.