sudo hadoop vs su hadoop -


has got strange environment issue , been forced use su rather sudo when calling hadoop commands?

sudo su -c 'hadoop fs -ls /' hdfs 
 found 4 items drwxr-xr-x   - hdfs   hdfs          0 2014-02-11 12:33 /apps drwx------   - mapred hdfs          0 2014-03-10 10:25 /mapred drwxrwxrwx   - hdfs   hdfs          0 2014-03-10 10:26 /tmp drwxr-xr-x   - hdfs   hdfs          0 2014-02-11 12:34 /user 

the environment allows finding of executable:

sudo -u hdfs 'hadoop'  
 usage: hadoop [--config confdir] command command 1 of:   namenode -format     format dfs filesystem ...   fs                   run generic filesystem user client ... ... commands print when invoked w/o parameters. 
sudo -u hdfs 'hadoop fs -ls /'  
 sudo: hadoop fs -ls: command not found 

i wondered if environment issue, gave me no hints:

sudo su -c 'env' hdfs | sort >sudo_su.txt sudo -u hdfs 'env' | sort >sudo.txt diff sudo.txt sudo_su.txt 
 11a12 > pwd=/home/user 14c15,16  shlvl=1 > sudo_command=/bin/su -c env hdfs 20a23 > _=/usr/bin/env 

drop quotes around hadoop command:

sudo -u hdfs hadoop fs -ls /


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -