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 28, 2018 in Big Data Hadoop by Shubham
• 13,490 points
14,346 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 28, 2018 by kurt_cobain
• 9,390 points
Hey, even after doing what you mentioned, I am still getting Command not found

How do I resolve that?

Hi@Vashist,

Check your .bashrc file and set the HADOOP_HOME and PATH properly.

export HADOOP_HOME=(put the path where you have your Hadoop folder)

export PATH=HADOOP_HOME/bin:$PATH

If you still getting the same error, please share your .bashrc file.

Thank You

Hey @Vashist,
It will be very helpful if you can share your .bashrc file, so I can help you out in a proper manner.

Related Questions In Big Data Hadoop

+1 vote
1 answer
0 votes
2 answers

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

On which version of hadoop do you ...READ MORE

answered Jul 24, 2019 in Big Data Hadoop by Lokesh Singh
3,766 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,490 points
15,551 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
• 69,230 points
3,916 views
+1 vote
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
• 11,380 points
10,921 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
108,293 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
• 11,380 points
8,875 views
–1 vote
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,390 points
4,545 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
• 58,100 points
2,611 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP