I am trying create a directory with the below commands:
hadoop fs -mkdir sample
hadoop fs -mkdir /user/cloudera/sample1
Either way i receive the error:
Could not find or load main class fs
How do I resolve this issue?
I am trying create a directory with the below commands:
hadoop fs -mkdir sample
hadoop fs -mkdir /user/cloudera/sample1
Either way i receive the error:
Could not find or load main class fs
How do I resolve this issue?
These two Stack Overflow posts illustrate that the hadoop fs
and hadoop dfs
commands are deprecated and have been for some time.
Ideally you should be using hdfs dfs
instead. As Ramya B states, you need to become the hdfs
user in order to use this type of command and ensure that safe mode is turned off. If you have Ambari, you can easily access the NameNode UI to check that this isn't the case.
Usage:
hdfs dfs -mkdir [hdfs location]
I would assume that the reason you're getting an error is because hadoop fs
is no longer a command you can use to execute filesystem changes on HDFS.
First give sudo su - hdfs and give hadoop dfsadmin -safemode leave Then user can run the commands