javahadoophdfsnamenodedatanode

There are 1 datanode(s) running and 1 node(s) are excluded in this operation. (pseudodistributed mode)


I am working with hadoop 2.7 using java and i have this error. I can create a file but i can not write in the file:

Errors:

ERROR File /test/1.txt 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.

I have read about this error but my datanode in not full.

I am working with a cluster of 1 single node which is working in linux (ubuntu 18.10). From my windows computer (on the same network) I access from java to my cluster


Solution

  • i have solved the problem.

    there was two posibilities:

    1) The datanode is full. Please check if your datanode is full --->

    i use this command $ dfs -du -h /

    Know the disk space of data nodes in hadoop?

    2) Or the second option is the datanode is not working fine. (your namenode could be working fine or not). (hdfs could let you create files but not write to them if namenode is up and datnode is down.)(if datanode and namenode are down, you could not create or write in the files). you can check your connection to datanode in core-site.xml.

    old-dated---------------:

        <?xml version="1.0"?>
        <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
    
        <configuration>
            <property>
                <name>fs.default.name</name>
                <value>hdfs://0.0.0.0:8020</value>
                <description>Nombre del filesystem por defecto.</description>
            </property>
        </configuration>
    

    up-dated---------------:

        <?xml version="1.0"?>
        <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
    
        <configuration>
            <property>
                <name>fs.default.name</name>
                <value>hdfs://ip_where_you_are_dating:8020</value>
                <description>Nombre del filesystem por defecto.</description>
            </property>
        </configuration>
    

    the second option:

    I'm trying to write a array bytes in a file but i can not. (I can create this file in FileSystem, and the conection is working). Any help is grateful