2 回答

TA貢獻2036條經(jīng)驗 獲得超8個贊
您需要確保已添加了一個環(huán)境變量HADOOP_CONF_DIR,該變量被調用以設置到包含來自 Hadoop 的 XML 文件的目錄中。
您可以.bashrc在主文件夾中執(zhí)行此操作
否則,您將獲得默認文件系統(tǒng) ,file://它仍然有效并且仍然可以正常運行 MapReduce 作業(yè)
FWIW,這是我的核心站點
$ cat /usr/local/Cellar/hadoop/3.1.1/libexec/etc/hadoop/core-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>file:///tmp/hadoop/hdfs/tmp</value>
<description>A base for other temporary directories.</description>
</property>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
和 hdfs 站點
$ cat /usr/local/Cellar/hadoop/3.1.1/libexec/etc/hadoop/hdfs-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>file:///tmp/hadoop/hdfs/names</value>
</property>
<property>
<name>fs.checkpoint.dir</name>
<value>file:///tmp/hadoop/hdfs/checkpoint</value>
</property>
<property>
<name>fs.checkpoint.edits.dir</name>
<value>file:///tmp/hadoop/hdfs/checkpoint-edits</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>file:///tmp/hadoop/hdfs/data</value>
</property>
</configuration>

TA貢獻1900條經(jīng)驗 獲得超5個贊
在 core-site.xml 文件中進行如下編輯。
<value>hdfs://localhost.localdomain:8020/</value>
我相信缺少斜線 (8020/) 會造成這個問題。嘗試一下。
添加回答
舉報