WARN hdfs.DFSUtil: Namenode for null remains unresolved for ID null异常会导致secondarynamenode守护进程无法开启

赵佐
2023-12-01

搭建hadoop并启动时 出现如下报错
19/06/02 07:17:33 WARN hdfs.DFSUtil: Namenode for null remains unresolved for ID null. Check your hdfs-site.xml file to ensure namenodes are configured properly.
警告异常时请查看core-site.xml文件内容是否正确

其实针对与下面的异常会导致我们的secondarynamenode进程无法启动


[root@master ~]# start-all.sh 
This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
19/06/02 07:17:33 WARN hdfs.DFSUtil: Namenode for null remains unresolved for ID null.  Check your hdfs-site.xml file to ensure namenodes are configured properly.
Starting namenodes on [opt]
opt: ssh: Could not resolve hostname opt: Temporary failure in name resolution
master: starting datanode, logging to /opt/hadoop-2.7.6/logs/hadoop-root-datanode-master.out
slaver1: starting datanode, logging to /opt/hadoop-2.7.6/logs/hadoop-root-datanode-slaver1.out
slaver2: starting datanode, logging to /opt/hadoop-2.7.6/logs/hadoop-root-datanode-slaver2.out
Starting secondary namenodes [0.0.0.0]
0.0.0.0: starting secondarynamenode, logging to /opt/hadoop-2.7.6/logs/hadoop-root-secondarynamenode-master.out
starting yarn daemons
starting resourcemanager, logging to /opt/hadoop-2.7.6/logs/yarn-root-resourcemanager-master.out
slaver1: starting nodemanager, logging to /opt/hadoop-2.7.6/logs/yarn-root-nodemanager-slaver1.out
slaver2: starting nodemanager, logging to /opt/hadoop-2.7.6/logs/yarn-root-nodemanager-slaver2.out
master: starting nodemanager, logging to /opt/hadoop-2.7.6/logs/yarn-root-nodemanag

我们修改我们得配置文件

[root@master hadoop]# vi 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>fs.default.name</name>
<value>hdfs://master:9000</value> //这里的master是我们的主机名。或者写ip地址也可以
</property>
<property>
<name>fs.defaultFS</name>
  <value>hdfs://master:9000</value>//这里的master是我们的主机名。或者写ip地址也可以
"core-site.xml" 31L, 1036C

我们也要修改我们的主机映射配置文件
/etc/hosts
在里面加入我们的主机名和ip地址即可

 类似资料: