sudo hadoop vs su hadoop
问题 Has anybody got into a strange environment issue and been forced to use SU rather than 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 the executable: sudo -u hdfs 'hadoop' Usage: hadoop [--config confdir] COMMAND where COMMAND is