gpt4 book ai didi

Hadoop2.7.0 NameNode格式java.lang.IllegalArgumentException : URI has an authority component

转载 作者:可可西里 更新时间:2023-11-01 16:30:05 24 4
gpt4 key购买 nike

我下载了 Hadoop 源代码以将 Hadoop 源代码本地导入 Eclipse 工作区。

我添加了 core-site.xmlhdfs-site.xmlhadoop-2.7.0-src/hadoop-hdfs-project/hadoop-hdfs/src/main/java目录内容。

在 Eclipse 中我运行了 NameNode.java

java NameNode.java -format

我收到以下错误消息:

 java.lang.IllegalArgumentException: URI has an authority component
at java.io.File.<init>(File.java:423)
at org.apache.hadoop.hdfs.server.namenode.NNStorage.getStorageDirectory(NNStorage.java:329)
at org.apache.hadoop.hdfs.server.namenode.FSEditLog.initJournals(FSEditLog.java:276)
at org.apache.hadoop.hdfs.server.namenode.FSEditLog.initJournalsForWrite(FSEditLog.java:247)
at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:984)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1428)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1553)
2016-06-17 11:12:54,404 INFO util.ExitUtil (ExitUtil.java:terminate(124)) - Exiting with status 1
2016-06-17 11:12:54,405 INFO namenode.NameNode (LogAdapter.java:info(47)) - SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at localhost/127.0.0.1
************************************************************/

我的core-site.xml:

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

<property>
<name>hadoop.tmp.dir</name>
<value>file:///Users/Joker/tmp</value>
</property>
</configuration>

我的hdfs-site.xml:

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

<property>
<name>dfs.namenode.name.dir</name>
<value>file://code/java/hadoop2.7.0/dfs/name</value>
</property>

<property>
<name>dfs.datanode.data.dir</name>
<value>file://code/java/hadoop2.7.0/dfs/data</value>
</property>
</configuration>

我没有设置HADOOP_HOME,我只是想在源代码中运行NameNode

最佳答案

实际上你已经在 core-site.xml 和 hdfs-site.xml 中设置了如下所示的路径

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

<property>
<name>hadoop.tmp.dir</name>
<value>/Users/Joker/tmp</value>
</property>
</configuration>

像这样在 hdfs-site.xml 中。

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

<property>
<name>dfs.namenode.name.dir</name>
<value>/code/java/hadoop2.7.0/dfs/name</value>
</property>

<property>
<name>dfs.datanode.data.dir</name>
<value>/code/java/hadoop2.7.0/dfs/data</value>
</property>
</configuration>

关于Hadoop2.7.0 NameNode格式java.lang.IllegalArgumentException : URI has an authority component,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37872800/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com