format”命令时出错?

0md85ypi  于 2021-05-27  发布在  Hadoop
关注(0)|答案(1)|浏览(607)

这个问题在这里已经有答案了

hadoop namenode格式化windows-java.lang.unsupportedoperationexception(2个答案)
8个月前关门了。
我键入了“hdfs namenode-format”命令来设置namenode。但我犯了下面这样的错误。

2019-10-20 04:15:57,279 INFO util.GSet: Computing capacity for map NameNodeRetryCache
2019-10-20 04:15:57,280 INFO util.GSet: VM type       = 64-bit
2019-10-20 04:15:57,281 INFO util.GSet: 0.029999999329447746% max memory 889 MB = 273.1 KB
2019-10-20 04:15:57,282 INFO util.GSet: capacity      = 2^15 = 32768 entries
2019-10-20 04:15:57,372 INFO namenode.FSImage: Allocated new BlockPoolId: BP-638256157-172.17.18.209-1571516157358
2019-10-20 04:15:57,377 ERROR namenode.NameNode: Failed to start namenode.
java.lang.UnsupportedOperationException
        at java.nio.file.Files.setPosixFilePermissions(Files.java:2044)
        at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:452)
        at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:591)
        at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:613)
        at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:188)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1206)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1649)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1759)
2019-10-20 04:15:57,388 INFO util.ExitUtil: Exiting with status 1: java.lang.UnsupportedOperationException
2019-10-20 04:15:57,395 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at YXYstyle/172.17.18.209

************************************************************/

我从下载了hadoop-3.2.1和winutilshttps://github.com/cdarlint/winutils 只需覆盖bin目录,如下所示。这是hadoop-3.2.1/bin目录的列表
下面是core-site.xml配置。

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

hadoop-env.cmd(顺便说一下:我已经设置了java\u home的环境变量):

@rem The java implementation to use.  Required.
set JAVA_HOME=%JAVA_HOME%

@rem The jsvc implementation to use. Jsvc is required to run secure datanodes.
@rem set JSVC_HOME=%JSVC_HOME%

hdfs-site.xml:

<configuration>

    <property>
        <name>dfs.replication</name>
        <value>1</value>
    </property>
    <property>
        <name>dfs.namenode.name.dir</name>
        <value>/hadoop-3.2.1/data/namenode</value>
    </property>
    <property>
        <name>dfs.datanode.data.dir</name>
        <value>/hadoop-3.2.1/data/datanode</value>
    </property>
</configuration>

yarn-site.xml:

<configuration>

<!-- Site specific YARN configuration properties -->
    <property>
        <name>yarn.nodemanager.resource.memory-mb</name>
        <value>1024</value>
    </property>
    <property>
        <name>yarn.nodemanager.resource.cpu-vcores</name>
        <value>1</value>
    </property>

</configuration>

我刚进入hadoop,对它完全陌生。有人能帮忙吗?提前谢谢。

ldioqlga

ldioqlga1#

似乎这是3.2.1版本中的一个bug。你可以看到这是四天前刚修好的。在早期的版本中还可以。我用2.6.0进行了测试,它正在工作,但没有用3.2.1
https://issues.apache.org/jira/browse/hdfs-14890

相关问题