hadoop dfs -mkdir

When I try to create a directory using:
hadoop dfs -mkdir /user/cloudera/flume/

I got the below:
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

mkdir: Failed on local exception: java.net.SocketException: Network is unreachable; Host Details : local host is: "localhost.localdomain/"; destination host is: "localhost.localdomain":8020;

I checked /etc/hosts file and it had localhost.localdomain localhost

Has anyone encountered this problem?

1 Answer(s)


hi Michael,

"Hadoop" commands is deprecated and will work fine. "hdfs" is the new command to work with hadoop 2.x installations.

Regarding the issue first check if you can list files from hdfs ("hdfs dfs -ls"), if you still get the socketexception, open firefox in cloudera VM, login to cloudera manager (login details: cloudera/cloudera). Once you login, it will take you to "All Services" page, look for "hdfs" service and click on the "Actions" dropdown and select "restart".

wait till the restart happens and see if the issue is resolved by re-executing the "hadoop mkdir" command. If the issue still persists, I suggest to restart the VM itself.