Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hadoop setting the HADOOP_HOME correctly to bin/hadoop it gives command not found

Tags:

hadoop

After installing hadoop and setting up HADOOP_HOME to /usr/local/hadoop/bin/hadoop and when running hadoop by just typing hadoop in terminal, it says that I don't have privileges. Then I tried running it with sudo then it says that, sudo : command not found

like image 581
Presly Chedhena Avatar asked Jun 08 '15 03:06

Presly Chedhena


People also ask

How to set environment variable for hadoop?

Set the $HADOOP_HOME environment variable as the file path to the Hadoop installation directory. If you do not set the $HADOOP_HOME environment before using the integration, you must run the lsfhadoop.sh connector script with the --hadoop-dir option to specify the file path to the Hadoop installation directory.

Where to set HADOOP_HOME?

You can find all the Hadoop configuration files in the location “$HADOOP_HOME/etc/hadoop”. It is required to make changes in those configuration files according to your Hadoop infrastructure.

How do I get the hadoop home path?

Navigate to the path where hadoop is installed. locate ${HADOOP_HOME}/etc/hadoop , e.g. When you type the ls for this folder you should see all these files. Core configuration settings are available in hadoop-env.sh.


2 Answers

  1. HADOOP_HOME should point to /usr/local/hadoop.

  2. If you want to type just hadoop in terminal, you have to add it in Global path variable. To do, add these lines in /home/hadoopuser/.bashrc:

    export HADOOP_HOME=/usr/local/hadoop

    export PATH=$PATH:$HADOOP_HOME/bin

NOTE: hadoopuser is your hadoop username. Replace it with your username.

like image 90
Rajesh N Avatar answered Nov 09 '22 22:11

Rajesh N


Add the following lines in ~/.bash_profile, if you are using Mac OS;

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home
export HADOOP_HOME=/Users/karanverma/Documents/backups/h/hadoop-2.6.4
export PATH=$PATH:$HADOOP_HOME/bin
export PATH=$PATH:$HADOOP_HOME/sbin
export HADOOP_PREFIX=/Users/karanverma/Documents/backups/h/hadoop-2.6.4
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME

export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib"
export HADOOP_CLASSPATH=${JAVA_HOME}/lib/tools.jar

export JAVA_LIBRARY_PATH=$HADOOP_HOME/lib/native:$JAVA_LIBRARY_PATH

export PATH=/usr/local/mysql/bin:/Users/bng/Documents/mongodb/bin:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$PATH
like image 44
KayV Avatar answered Nov 10 '22 00:11

KayV