Writing to HDFS could only be replicated to 0 nodes instead of minReplication (=1)
1.Stop all Hadoop daemons
for x in `cd /etc/init.d ; ls hadoop*` ; do sudo service $x stop ; done
2.Remove all files from /var/lib/hadoop-hdfs/cache/hdfs/dfs/name
Eg: devan@Devan-PC:~$ sudo rm -r /var/lib/hadoop-hdfs/cache/
3.Format Namenode
sudo -u hdfs hdfs namenode -format
4.Start all Hadoop daemons
for x in `cd /etc/init.d ; ls hadoop*` ; do sudo service $x start ; done
Stop All Hadoop Service
I had the same issue, I was running very low on disk space. Freeing up disk solved it.
- Check whether your DataNode is running,use the command:
jps
. - If it is not running wait sometime and retry.
- If it is running, I think you have to re-format your DataNode.