Permission denial


6 Answer(s)


Hi Ritu,

Cloudera doesn't let you access any other directory except /user/cloudera only.

To aceess other directory, you ned permission as sudo. Enter this in your code and it will work:

 - $ sudo -u hdfs hadoop fs -mkdir /wordcount

Please let me know if this works for you or not.

Thanks.


Still no luck ....please see error below

[cloudera@localhost ~]$ ls
datasets  Documents  eclipse  Music     Public     Videos     workspace
Desktop   Downloads  lib      Pictures  Templates  wordcount
[cloudera@localhost ~]$ cd wordcount/input/
[cloudera@localhost input]$ sudo -u hdfs hadoop fs -mkdir /wordcount
mkdir: Cannot create directory /wordcount. Name node is in safe mode.
[cloudera@localhost input]$ 
 



Hi Ritu,

The Hadoop Cluster is in safemode. To leave safemode, please enter the following command:

$ hadoop -safemode leave

Hope this helps.

Thanks


Doesn't work....

[cloudera@localhost input]$ hadoop -safemode leave
Error: No command named `-safemode' was found. Perhaps you meant `hadoop safemode'
[cloudera@localhost input]$ 
 


Hi Ritu

Its - hadoop safemode -leave

thanks


Its really frustrating, nothing worked so far, please see the output below

[cloudera@localhost input]$ hadoop safemode -leave
Exception in thread "main" java.lang.NoClassDefFoundError: safemode
Caused by: java.lang.ClassNotFoundException: safemode
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: safemode.  Program will exit.
[cloudera@localhost input]$ sudo -u hdfs hadoop dfsadmin -safemode leave
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

Safe mode is OFF
[cloudera@localhost input]$ hadoop fs -mkdir /wordcount
mkdir: Permission denied: user=cloudera, access=WRITE, inode="/":hdfs:supergroup:drwxr-xr-x
[cloudera@localhost input]$