Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Cannot write a file into the cluster. Could only be replicated to 0 nodes instead of minReplication (=1) error.

Highlighted

Cannot write a file into the cluster. Could only be replicated to 0 nodes instead of minReplication (=1) error.

New Contributor

Hi guys! First of all, I am new in Hortonworks.

I try to write a file (CSV format) into the cluster but I got this error from the console.

File /user/hdfs/forPablo/erp.sql could only be replicated to 0 nodes instead of minReplication (=1).  There are 1 datanode(s) running and 1 node(s) are excluded in this operation.

The file is created without data. I have checked these links but I do not work for me

https://community.hortonworks.com/questions/82072/file-userroottmptesttxt-could-only-be-replicated-t....

https://community.hortonworks.com/questions/60754/replicated-to-0-nodes-instead-of-minreplication-hd...

https://community.hortonworks.com/questions/78692/file-usrartikelcsv-could-only-be-replicated-to-0-n...

https://community.hortonworks.com/questions/66276/parquet-jackson-141jar-could-only-be-replicated-to...

and more... Please, anyone could help me? Thx!

1 REPLY 1

Re: Cannot write a file into the cluster. Could only be replicated to 0 nodes instead of minReplication (=1) error.

Guru

@AA MJ, How many datanodes do you have in cluster ? As per message , it seams you only have one datanode. Ideally, you should have 3 datanodes atleast to manage replication correctly.

However, as per this message it means that you have only one data node and that data node is excluded. Can you please check content of /etc/hadoop/conf/dfs.hosts.exclude ? If the datanode is added to exclude host list, this behavior is expected.

If data node is not added to exclude list and still you are noticing issue with replication, you can restart the datanode and try again.