启动Hadoop时遇到Name or service not knownstname 错误

今天在启动Hadoop时遇到Name or service not knownstname这样的错误

1 : Name or service not knownstname master 
2 : Name or service not knownstname slaver1 
3 : Name or service not knownstname slaver2

原因:slaves文件可能被污染了。

解决方法:删除掉slaves文件,重新建立一个slaves文件,并配置好就可以了。

[root@master sbin]# ./start-all.sh
This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
Starting namenodes on [master]
The authenticity of host 'master (10.0.0.110)' can't be established.
RSA key fingerprint is 90:b6:9e:d0:3e:76:27:ce:34:3b:d6:b4:41:5d:e7:31.
Are you sure you want to continue connecting (yes/no)? yes
master: Warning: Permanently added 'master,10.0.0.110' (RSA) to the list of known hosts.
master: starting namenode, logging to /opt/hadoop_resources/hadoop-2.7.0/logs/hadoop-root-namenode-master.out
slaver1: starting datanode, logging to /opt/hadoop_resources/hadoop-2.7.0/logs/hadoop-root-datanode-slaver1.out
slaver2: starting datanode, logging to /opt/hadoop_resources/hadoop-2.7.0/logs/hadoop-root-datanode-slaver2.out
master: starting datanode, logging to /opt/hadoop_resources/hadoop-2.7.0/logs/hadoop-root-datanode-master.out
starting yarn daemons
starting resourcemanager, logging to /opt/hadoop_resources/hadoop-2.7.0/logs/yarn-root-resourcemanager-master.out
slaver2: starting nodemanager, logging to /opt/hadoop_resources/hadoop-2.7.0/logs/yarn-root-nodemanager-slaver2.out
slaver1: starting nodemanager, logging to /opt/hadoop_resources/hadoop-2.7.0/logs/yarn-root-nodemanager-slaver1.out
master: starting nodemanager, logging to /opt/hadoop_resources/hadoop-2.7.0/logs/yarn-root-nodemanager-master.out
[root@master sbin]# jps
1926 ResourceManager
1597 NameNode
2020 NodeManager
2054 Jps
1688 DataNode

下面关于Hadoop的文章您也可能喜欢,不妨看看:

Ubuntu14.04下Hadoop2.4.1单机/伪分布式安装配置教程 

CentOS安装和配置Hadoop2.2.0 

Ubuntu 14.04 LTS下安装Hadoop 1.2.1(伪分布模式)

Ubuntu上搭建Hadoop环境(单机模式+伪分布模式)

Ubuntu下Hadoop环境的配置

单机版搭建Hadoop环境图文教程详解

Hadoop 2.6.0 HA高可用集群配置详解 

Spark 1.5、Hadoop 2.7 集群环境搭建 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/3e71e02709f405b8464e36f155e74793.html