简体   繁体   English

没有在hadoop 2.9.2中运行的datanode

[英]No datanode running in hadoop 2.9.2

I'm very new to hadoop, so I've started following the hadoop 2.9.2 getting started . 我对hadoop很新,所以我开始关注hadoop 2.9.2开始了 When I run the command 当我运行命令

    bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.9.2.jar grep input output 'dfs[a-z.]+'

it returns a success, but when I look at the output/part-r-00000.txt file, which is meant to show the result, it is empty, even though the input directory contains the .xml files of etc/hadoop as it is supposed to. 它返回成功,但是当我查看output/part-r-00000.txt文件时,它是为了显示结果,它是空的,即使input目录包含etc/hadoop.xml文件,因为它应该。

I've started the whole process over and over again, reading all the logs, in order to understand where the error might be. 我已经一遍又一遍地开始整个过程​​,读取所有日志,以便了解错误的位置。 Anyway, when I run the bin/hdfs namenode -format , it shows me this error: 无论如何,当我运行bin/hdfs namenode -format ,它会显示以下错误:

    ERROR common.Util: Syntax error in URI file://path to temp_directory/dfs/name. Please check hdfs configuration.
    java.net.URISyntaxException: Illegal character in authority at index 7: file://path to temp_directory/dfs/name
at java.base/java.net.URI$Parser.fail(URI.java:2915)
at java.base/java.net.URI$Parser.parseAuthority(URI.java:3249)
at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3160)
at java.base/java.net.URI$Parser.parse(URI.java:3116)
at java.base/java.net.URI.<init>(URI.java:600)
at org.apache.hadoop.hdfs.server.common.Util.stringAsURI(Util.java:49)
at org.apache.hadoop.hdfs.server.common.Util.stringCollectionAsURIs(Util.java:99)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getStorageDirs(FSNamesystem.java:1466)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getNamespaceEditsDirs(FSNamesystem.java:1511)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getNamespaceEditsDirs(FSNamesystem.java:1480)
at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1137)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1614)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1741)

and also this occurs when I run bin/hdfs dfs -put etc/hadoop input : 当我运行bin/hdfs dfs -put etc/hadoop input时也会发生这种情况:

    WARN hdfs.DataStreamer: DataStreamer Exception
    org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /user/federico/input/hadoop/capacity-scheduler.xml._COPYING_ could only be replicated to 0 nodes instead of minReplication (=1).  There are 0 datanode(s) running and no node(s) are excluded in this operation.

it seems pretty clear that there are no datanodes running. 似乎很清楚,没有数据节点在运行。 So, assumed this situation, how can I initialize a datanode to make things work, and how do I know if my datanode is running as it is expected to? 因此,假设这种情况,我如何初始化datanode以使工作正常,以及如何知道我的datanode是否按预期运行?

EDIT: I've tried to follow some suggestion fro different users experiencing a similar problem and tihs error came out: 编辑:我试图跟随一些建议,不同的用户遇到类似的问题,并出现错误:

    WARN org.apache.hadoop.hdfs.server.datanode.checker.StorageLocationChecker: Exception checking StorageLocation [DISK]file:/dfs/data
    java.io.FileNotFoundException: File file:/dfs/data does not exist

and thus the datanode creation fails. 因此datanode创建失败。 How do I deal with it? 我该如何处理?

Please update you hdfs-site.xml as follows where dfs.datanode.data.dir value should be set as per your expectations. 请按照以下更新hdfs-site.xml,其中dfs.datanode.data.dir值应根据您的期望设置。 You can find this file under /etc/hadoop under Hadoop directory. 您可以在Hadoop目录下的/ etc / hadoop下找到此文件。

<configuration>
<property>
      <name>dfs.replication</name>
      <value>1</value>
   </property>
   <property>
      <name>dfs.permissions</name>
      <value>false</value>
   </property>

   <property>
      <name>dfs.datanode.data.dir</name>
      <value>/Users/myname/data/hdfs/data</value>
   </property>
</configuration>

Use similar paths for linux as /home/myname/data/hdfs/data 使用与/ home / myname / data / hdfs / data类似的linux路径

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM