Hadoop 启动-all.cmd 命令:数据节点正在关闭

Hadoop start-all.cmd command : datanode shutting down

我正在尝试在我的 windows 10

中安装 hadoop

参考:https://github.com/MuhammadBilalYar/Hadoop-On-Window/wiki/Step-by-step-Hadoop-2.8.0-installation-on-Window-10

Hadoop start-all.cmd 命令启动 namenode , resourceManager 和 nodeManager 成功但数据节点未启动

错误::

checker.StorageLocationChecker: Exception checking StorageLocation [DISK]file:/C:/hadoop-3.1.1/data/datanode
java.lang.UnsatisfiedLinkError: org.apache.hadoop.io.nativeio.NativeIO$POSIX.stat(Ljava/lang/String;)Lorg/apache/hadoop/io/nativeio/NativeIO$POSIX$Stat;
        at org.apache.hadoop.io.nativeio.NativeIO$POSIX.stat(Native Method)
        at org.apache.hadoop.io.nativeio.NativeIO$POSIX.getStat(NativeIO.java:455)
        at org.apache.hadoop.fs.RawLocalFileSystem$DeprecatedRawLocalFileStatus.loadPermissionInfoByNativeIO(RawLocalFileSystem.java:796)
        at org.apache.hadoop.fs.RawLocalFileSystem$DeprecatedRawLocalFileStatus.loadPermissionInfo(RawLocalFileSystem.java:710)
        at org.apache.hadoop.fs.RawLocalFileSystem$DeprecatedRawLocalFileStatus.getPermission(RawLocalFileSystem.java:678)
        at org.apache.hadoop.util.DiskChecker.mkdirsWithExistsAndPermissionCheck(DiskChecker.java:233)
        at org.apache.hadoop.util.DiskChecker.checkDirInternal(DiskChecker.java:141)
        at org.apache.hadoop.util.DiskChecker.checkDir(DiskChecker.java:116)
        at org.apache.hadoop.hdfs.server.datanode.StorageLocation.check(StorageLocation.java:239)
        at org.apache.hadoop.hdfs.server.datanode.StorageLocation.check(StorageLocation.java:52)
        at org.apache.hadoop.hdfs.server.datanode.checker.ThrottledAsyncChecker.call(ThrottledAsyncChecker.java:142)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
2018-12-28 11:19:03,023 ERROR datanode.DataNode: Exception in secureMain
org.apache.hadoop.util.DiskChecker$DiskErrorException: Too many failed volumes - current valid volumes: 0, volumes configured: 1, volumes failed: 1, volume failures tolerated: 0
        at org.apache.hadoop.hdfs.server.datanode.checker.StorageLocationChecker.check(StorageLocationChecker.java:220)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.makeInstance(DataNode.java:2762)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:2677)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.createDataNode(DataNode.java:2719)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.secureMain(DataNode.java:2863)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.main(DataNode.java:2887)
2018-12-28 11:19:03,031 INFO util.ExitUtil: Exiting with status 1: org.apache.hadoop.util.DiskChecker$DiskErrorException: Too many failed volumes - current valid volumes: 0, volumes configured: 1, volumes failed: 1, volume failures tolerated: 0
2018-12-28 11:19:03,079 INFO datanode.DataNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down DataNode at BHARTI/192.168.2.161
************************************************************/

我从

成功安装了hadoop 2.8.0

参考:https://github.com/MuhammadBilalYar/Hadoop-On-Window/wiki/Step-by-step-Hadoop-2.8.0-installation-on-Window-10

我安装了hadoop 2.8.0

参考:https:Hadoop on windows

更改 xml 文件或从站点复制文件时要小心,站点的 etc 文件仍需要更改。

我遇到了同样的错误,然后我发现我没有为 hdfs-site.xml 文件中的数据节点和名称节点提供正确的路径值,更正后它工作正常

我正在发布对我有用的内容。 在etc/hadoop/core-site.xml中保持如下配置

<configuration>
<property>
    <name>fs.defaultFS</name>
    <value>hdfs://localhost:9000</value>
</property>

在etc/hadoop/hdfs-site.xml中保持如下配置

    <configuration>
  <property>
        <name>dfs.replication</name>
        <value>1</value>
    </property>
<property> 
<name>dfs.namenode.name.dir</name> 
<value>file:///C:/hadoop-3.2.2/data/namenode</value> //Your path to namenode may be different 
</property> 

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

现在运行命令hdfs namenode -format在bin目录和sbin目录运行start-dfs.cmd。如果没有错误,Datanode 现在应该运行。

如果您无法上传文件,您需要更改权限。例如,假设您使用命令 hdfs dfs -mkdir user 创建了一个名为 user 的目录。默认情况下,权限将为 'drwxr-xr-x'。您需要使用命令 hdfs dfs -chmod 777 /user 更改它。权限将设置为 'drwxrwxrwx'。现在您可以上传和下载文件了。