Home:ALL Converter>OSX - Unable to copy files from local file system to hdfs

OSX - Unable to copy files from local file system to hdfs

Ask Time:2013-10-01T16:02:54         Author:chandra

Json Formatter

I'm trying to copy files from a local file system to the HDFS and it throws up an error indicating the file could only be replicated to 0 nodes instead of 1.

ckharide-mac:bin hadoop$ ./hadoop dfs -copyFromLocal /tmp/wcinput /user/hadoop/app/input
13/10/01 13:25:05 WARN hdfs.DFSClient: DataStreamer Exception: org.apache.hadoop.ipc.RemoteException: java.io.IOException: File /user/hadoop/app/input/LICENSE.txt could only be replicated to 0 nodes, instead of 1
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:1920)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock(NameNode.java:783)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:587)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1432)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1428)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:396)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
    at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1426)

I was able to create the directory though but copying of files doesn't work. I have tried reformatting the name node and stopped/starting the hadoop services still the problem persists.

Any help please is appreciated.

Author:chandra,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/19110972/osx-unable-to-copy-files-from-local-file-system-to-hdfs
Naytzyrhc :

some things you can do: \n\n\nreformat: $HADOOP_HOME/bin/hadoop namenode -format \nCheck System Preferences->Sharing->Remote Login activated? \nrestart hadoop $HADOOP_HOME/bin/stop-all.sh and then $HADOOP_HOME/bin/start-all.sh\n\n\nI ran into the same issue the other day on my Mac and above steps at least helped me out...",
2013-10-01T08:09:50
chandra :

Thanks that fixed it there wasnt any space on the HDFS and that gets recognized only when we move files from teh local file system to the HDFS one . Once i addressed that i did a format and followed the start of the hadopp services and it worked. ",
2013-10-01T15:43:56
yy