Reputation: 143
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
Upvotes: 5
Views: 22651
Reputation: 13835
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
Upvotes: 1
Reputation: 2574
HADOOP_HOME
should point to /usr/local/hadoop
.
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.
Upvotes: 7