java.io.IOException: File /user/hadoop/ could only be replicated to 0 nodes, instead of 1

0 votes

I am trying to upload file in my hdfs cluster from client, but It shows me the below error. 

java.io.IOException: File /user/hadoop could only be replicated to 0 nodes, instead of 1
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:1448)
at org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock(NameNode.java:690)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.ipc.WritableRpcEngine$Server.call(WritableRpcEngine.java:342)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1350)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1346)
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:742)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1344)

How can I solve this error?

Apr 17 in Big Data Hadoop by akhtar
• 10,580 points
45 views

1 answer to this question.

0 votes

Hi@akhtar,

To avoid this error, follow the bellow given steps.

  • Stop all hadoop services

  • Delete dfs/name and dfs/data directories

  • Run hadoop namenode -format  -Y

  • Start hadoop services again

Hope these steps will help you.

answered Apr 17 by MD
• 23,050 points

Related Questions In Big Data Hadoop

0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,920 points
5,086 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,920 points
724 views
+1 vote
11 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyF ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
30,124 views
0 votes
1 answer

main" java.io.IOException: Mkdirs failed to create /user/hadoop/name.

Hi@akhtar,  I think you missed to add below property ...READ MORE

answered Apr 17 in Big Data Hadoop by MD
• 23,050 points
30 views