MapR 5.0 Documentation : Configure Mahout

Complete one of the following procedures to configure Mahout:

Set Environment Variables for the Current User

  1. Set JAVA_HOME the path of the Java directory.

    Ubuntu Example
    $ export JAVA_HOME=/usr/lib/jvm/<version>
    RedHat / CentOS Example
    $ export JAVA_HOME=/usr/java/<version> 
  2. Set HADOOP_CONF_DIR to the path of the directory containing the Hadoop configuration parameters. 

    MapReduce V1 Example
    $ export HADOOP_CONF_DIR=/opt/mapr/hadoop/hadoop-<version>/conf
    YARN Example
    $ export HADOOP_CONF_DIR=/opt/mapr/hadoop/hadoop-<version>/etc/hadoop/


A user who doesn't have root or sudo permissions can add these environment variable entries to the ~/.bashrc file so that the environment variables will be set each time the user logs in.


Set Environment Variables for all Users on the Node

You can set these environment variables persistently for all users by adding them to the /etc/environment file as root or using sudo. 

  1.  As root or using sudo, set JAVA_HOME and HADOOP_CONF_DIR in the /etc/environment file.

    Ubuntu Example with MapReduce v1
    RedHat / CentOS Example with YARN
    The order of the environment variables in the file doesn't matter.
  2. Run the following command to activate the environment variables for the current session: 

    $ source /etc/environment