MapR 5.0 Documentation : Install Spark on YARN

This document contains instructions to install Spark on YARN using manual steps. You can also install Spark on YARN using the MapR Installer. 

 Spark is distributed as two separate packages:

mapr-sparkThe mapr-spark package is dependent on the mapr-client package.
mapr-spark-historyserverThis optional package installs the Spark History Server.


To install Spark on YARN (Hadoop 2), execute the following commands as root or using sudo: 

  1. Verify that JDK 1.7 or later is installed on node where you want to install Spark.

  2.  Create the /apps/spark directory on MapR-FS and set the correct permissions on the directory. 

    hadoop fs -mkdir /apps/spark
    hadoop fs -chmod 777 /apps/spark
  3. Install the packages.

    On Ubuntu...
    apt-get install mapr-spark mapr-spark-historyserver
    On RedHat / CentOS...
    yum install mapr-spark mapr-spark-historyserver
  4. Run the command:

    /opt/mapr/server/ -R


To test the installation, run the following command as the mapr user:

MASTER=yarn-client /opt/mapr/spark/spark-<version>/bin/run-example org.apache.spark.examples.SparkPi 10

This command will fail if it is run as the root user.