Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/hadoop/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hadoop 只能写入1个复制节点中的0个。有0个数据节点正在运行,此操作中排除了0个节点_Hadoop - Fatal编程技术网

Hadoop 只能写入1个复制节点中的0个。有0个数据节点正在运行,此操作中排除了0个节点

Hadoop 只能写入1个复制节点中的0个。有0个数据节点正在运行,此操作中排除了0个节点,hadoop,Hadoop,我在两个集群上设置了hadoop,并在主节点中尝试使用以下命令放置文件: hadoop fs-put test.txt/mydata/ 我得到了以下错误: put: File /mydata/test.txt._COPYING_ could only be written to 0 of the 1 minReplication nodes. There are 0 datanode(s) running and 0 node(s) are excluded in this operation.

我在两个集群上设置了hadoop,并在主节点中尝试使用以下命令放置文件: hadoop fs-put test.txt/mydata/ 我得到了以下错误:

put: File /mydata/test.txt._COPYING_ could only be written to 0 of the 1 minReplication nodes. There are 0 datanode(s) running and 0 node(s) are excluded in this operation.
当我键入
hdfs dfsadmin-report
时,它提供了以下信息:

WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Configured Capacity: 0 (0 B)
Present Capacity: 0 (0 B)
DFS Remaining: 0 (0 B)
DFS Used: 0 (0 B)
DFS Used%: 0.00%
Replicated Blocks:
    Under replicated blocks: 0
    Blocks with corrupt replicas: 0
    Missing blocks: 0
    Missing blocks (with replication factor 1): 0
    Low redundancy blocks with highest priority to recover: 0
    Pending deletion blocks: 0
Erasure Coded Block Groups: 
    Low redundancy block groups: 0
    Block groups with corrupt internal blocks: 0
    Missing block groups: 0
    Low redundancy blocks with highest priority to recover: 0
    Pending deletion blocks: 0
INFO ipc.Client: Retrying connect to server: master/172.31.81.91:10001. Already tried 0 time(s); maxRetries=45
然后,当我尝试使用
hadoop fs-ls/
从datanode访问hdfs时,它提供了以下信息:

WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Configured Capacity: 0 (0 B)
Present Capacity: 0 (0 B)
DFS Remaining: 0 (0 B)
DFS Used: 0 (0 B)
DFS Used%: 0.00%
Replicated Blocks:
    Under replicated blocks: 0
    Blocks with corrupt replicas: 0
    Missing blocks: 0
    Missing blocks (with replication factor 1): 0
    Low redundancy blocks with highest priority to recover: 0
    Pending deletion blocks: 0
Erasure Coded Block Groups: 
    Low redundancy block groups: 0
    Block groups with corrupt internal blocks: 0
    Missing block groups: 0
    Low redundancy blocks with highest priority to recover: 0
    Pending deletion blocks: 0
INFO ipc.Client: Retrying connect to server: master/172.31.81.91:10001. Already tried 0 time(s); maxRetries=45
我在2个aws ubuntu实例上设置了该实例,并打开了所有TCP/IPV4端口。我有以下设置:

在两种设置上:

core-site.xml 工人 当我输入
jps

主人 数据节点 当我键入
sudo netstat-ntlp
时,我可以得到:

大师: 数据节点:
我正在使用hadoop 3.1.3,任何帮助都将不胜感激!谢谢

经过多次尝试后,我迅速给出了答案

  • 如果使用AWS,所有ip都应该是公共ip
  • 在core-site.xml中,使用公共dns而不是IP
  • 格式化后删除数据节点文件。不知道为什么。。。但这确实解决了我的问题

  • 谢谢你的帮助

    您的datanode无法向namenode注册自身。检查namenode和datanode日志中是否存在错误。另外,请确认两个节点中是否都有
    core site.xml
    hdfs site.xml
    文件
    <configuration>
       <property>
           <name>mapreduce.framework.name</name>
          <value>yarn</value>
       </property>
        <property>
                <name>yarn.app.mapreduce.am.env</name>
                <value>HADOOP_MAPRED_HOME=$HADOOP_HOME</value>
        </property>
        <property>
                <name>mapreduce.map.env</name>
                <value>HADOOP_MAPRED_HOME=$HADOOP_HOME</value>
        </property>
        <property>
                <name>mapreduce.reduce.env</name>
                <value>HADOOP_MAPRED_HOME=$HADOOP_HOME</value>
        </property>
    </configuration>
    
    127.0.0.1 localhost
    172.31.81.91 master
    172.31.45.232 slave-1
    
    # The following lines are desirable for IPv6 capable hosts
    ::1 ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts
    
    172.31.45.232
    
    12532 NameNode
    12847 SecondaryNameNode
    13599 Jps
    
    5172 Jps
    4810 DataNode
    
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
    tcp        0      0 0.0.0.0:9870            0.0.0.0:*               LISTEN      12532/java          
    tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      696/systemd-resolve 
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1106/sshd           
    tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      809/cupsd           
    tcp        0      0 172.31.81.91:9000       0.0.0.0:*               LISTEN      12532/java          
    tcp        0      0 0.0.0.0:9868            0.0.0.0:*               LISTEN      12847/java          
    tcp6       0      0 :::80                   :::*                    LISTEN      1176/apache2        
    tcp6       0      0 :::22                   :::*                    LISTEN      1106/sshd           
    tcp6       0      0 ::1:631                 :::*                    LISTEN      809/cupsd          
    
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
    tcp        0      0 0.0.0.0:9864            0.0.0.0:*               LISTEN      4810/java           
    tcp        0      0 0.0.0.0:9866            0.0.0.0:*               LISTEN      4810/java           
    tcp        0      0 0.0.0.0:9867            0.0.0.0:*               LISTEN      4810/java           
    tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      691/systemd-resolve 
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1142/sshd           
    tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      854/cupsd           
    tcp        0      0 127.0.0.1:45029         0.0.0.0:*               LISTEN      4810/java           
    tcp6       0      0 :::22                   :::*                    LISTEN      1142/sshd           
    tcp6       0      0 ::1:631                 :::*                    LISTEN      854/cupsd