hadoop: command not found

0 votes

I hadoop installed in a linux machine. I have started the hadoop via the command /usr/local/hadoop/bin/start-all.sh and this is the prompt I am getting:

namenode running as process 7876. Stop it first.
localhost: datanode running as process 8083. Stop it first.
localhost: secondarynamenode running as process 8304. Stop it first.
jobtracker running as process 8398. Stop it first.
localhost: tasktracker running as process 8612. Stop it first

But when i am trying to push the data into hdfs using the command given below:

jeet@jeet-Vostro-2520:~$ hadoop fs -put gettysburg.txt /user/jeet/getty/gettysburg.txt
hadoop: command not found

I am new to Hadoop. Can someone help me to resolve the issue?

Mar 27, 2018 in Big Data Hadoop by Shubham
• 13,190 points
2,236 views

1 answer to this question.

0 votes

The reason you are getting hadoop as unknown command because you have not exported hadoop path in the environment variable. In order to solve it, you need to edit your .bashrc file Here, are the steps that you have to follow:

  • open ~/.bashrc file (like gedit ~/.bashrc)
  • Add the following lines in the same file and save it:
export PATH=$PATH:/usr/local/hadoop/bin/

Now you can run the hadoop commands from any directory.

answered Mar 27, 2018 by kurt_cobain
• 9,240 points

Related Questions In Big Data Hadoop

+1 vote
1 answer
0 votes
1 answer

start-dfs.sh command is not starting Hadoop JobTracker & TaskTracker

start-dfs.sh script, only starts the HDFS daemons. ...READ MORE

answered Apr 15, 2018 in Big Data Hadoop by Shubham
• 13,190 points
533 views
0 votes
2 answers

Hadoop is not able to find jps command

jps is actually not a command of ...READ MORE

answered Apr 18, 2018 in Big Data Hadoop by Shubham
• 13,190 points
1,444 views
0 votes
1 answer

Hadoop Mapreduce: Class Not Found Exception

Try adding this Job job = new Job(conf, ...READ MORE

answered Oct 29, 2018 in Big Data Hadoop by Omkar
• 67,120 points
315 views
0 votes
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,110 points
2,055 views
0 votes
10 answers

hadoop fs -put command?

copy command can be used to copy files ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Sujay
10,515 views
0 votes
1 answer
+1 vote
1 answer

Where to set hadoop.tmp.dir? core-site.xml or hdfs-site.xml?

hadoop.tmp.dir (A base for other temporary directories) is ...READ MORE

answered Mar 26, 2018 in Big Data Hadoop by nitinrawat895
• 10,110 points
1,528 views
0 votes
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,240 points
767 views
0 votes
3 answers

Cloudera Hadoop - Daemons not running

Please run below mentioned command. It will ...READ MORE

answered Aug 7, 2018 in Big Data Hadoop by Priyaj
• 56,160 points
494 views