Reply
Expert Contributor
Posts: 316
Registered: ‎01-25-2017

Re: Excution of the following command gives warning and not executed

@subbu You are doing the same error all the time.

 

In order to write or read from and to the jdfs the user running the command need permissions.

 

You can solve this by always running with the super user "hdfs" and in order to do that you need to add for you command sudo -u hdfs, so your command should be :

 

sudo -u hdfs hadoop jar /home/cloudera/WordCount.jar WordCount /inputnew/inputfile.txt /outputnew

 

or as i see all the time you are running with cloudera user so you need to change the owner of / to cloudera or you can change the permissions to the root folder.

 

so:

 

1- use the super user: 

 

sudo -u hdfs hadoop jar /home/cloudera/WordCount.jar WordCount /inputnew/inputfile.txt /outputnew

 

2- change root dir to cloudera-scm:

 

sudo -u hdfs  hdfs -chown -R cloudera /

then run:

hadoop jar /home/cloudera/WordCount.jar WordCount /inputnew/inputfile.txt /outputnew

 

 

 

3- change the permissions:

 

sudo -u hdfs  hdfs -chmod -R 777   / then run:

 

hadoop jar /home/cloudera/WordCount.jar WordCount /inputnew/inputfile.txt /outputnew

 

 

 

New Contributor
Posts: 11
Registered: ‎04-13-2018

Re: Excution of the following command gives warning and not executed

sir while i am trying to exucute this getting error

cloudera@localhost ~]$ sudo -u hdfs hdfs -chown -R cloudera /
Unrecognized option: -chown
Could not create the Java virtual machine.

Expert Contributor
Posts: 316
Registered: ‎01-25-2017

Re: Excution of the following command gives warning and not executed

sudo -u hdfs hdfs dfs -chown -R cloudera /
New Contributor
Posts: 11
Registered: ‎04-13-2018

Re: Excution of the following command gives warning and not executed

thank u very much sir,its working and i am able run and got an output also

 

Highlighted
New Contributor
Posts: 11
Registered: ‎04-13-2018

Re: Excution of the following command gives warning and not executed

While executing this command I am getting error as
[cloudera@localhost ~]$ hadoop jar /home/cloudera/WordCount.jar WordCount /inputnew/inputfile.txt /op
18/04/22 07:40:40 INFO ipc.Client: Retrying connect to server: localhost.localdomain/127.0.0.1:8021. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
Expert Contributor
Posts: 316
Registered: ‎01-25-2017

Re: Excution of the following command gives warning and not executed

Where did you get this command from?

 

Are you have the hadoop-example jar?

 

Check the jars under /home/cloudera/ by running ll /home/cloudera/

 

 

Announcements