Hadoop多节点群集:从节点连接失败

时间:2018-03-16 15:08:34

标签: hadoop cluster-computing yarn hadoop2

我试图使用我的Hadoop Multinode Cluster

  • 1 Namenode(master)
  • 2 Datanodes(slave1& slave2)

我想用MapReduce进行一些测试,但我遇到了问题,而且我找不到任何地方可以解决这个问题。

我上传了一个名为 data.txt 的文件HDFS

我创建了两个文件: mapper.py reducer.py ,这些文件存储在我的hadoop本地存储库中。

我执行了这个命令:

hadoop jar /usr/local/hadoop-2.7.5/share/hadoop/tools/lib/hadoop-streaming-2.7.5.jar 
-mapper /usr/local/hadoop/mapper.py -reducer /usr/local/hadoop/reducer.py 
-input hdfs://master:54310/data.txt -output hdfs://master:54310/output.txt

在我的终端中,我有这个问题:

packageJobJar: [/tmp/hadoop-unjar6386556681700293769/] [] /tmp/streamjob2613722562503212451.jar tmpDir=null
18/03/16 15:45:02 INFO client.RMProxy: Connecting to ResourceManager at master/172.30.10.64:8050
18/03/16 15:45:03 INFO client.RMProxy: Connecting to ResourceManager at master/172.30.10.64:8050
18/03/16 15:45:05 INFO mapred.FileInputFormat: Total input paths to process : 1
18/03/16 15:45:05 INFO mapreduce.JobSubmitter: number of splits:2
18/03/16 15:45:05 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1521211085961_0001
18/03/16 15:45:06 INFO impl.YarnClientImpl: Submitted application application_1521211085961_0001
18/03/16 15:45:06 INFO mapreduce.Job: The url to track the job: http://master:8088/proxy/application_1521211085961_0001/
18/03/16 15:45:06 INFO mapreduce.Job: Running job: job_1521211085961_0001
18/03/16 15:45:21 INFO mapreduce.Job: Job job_1521211085961_0001 running in uber mode : false
18/03/16 15:45:21 INFO mapreduce.Job:  map 0% reduce 0%
18/03/16 15:45:39 INFO mapreduce.Job: Task Id : attempt_1521211085961_0001_m_000001_0, Status : FAILED
Error: java.lang.RuntimeException: Error in configuring object
    at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
    at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:78)
    at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
    at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:450)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343)
    at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:422)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1754)
    at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
    ... 9 more
Caused by: java.lang.RuntimeException: Error in configuring object
    at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
    at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:78)
    at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
    at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)
    ... 14 more
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
    ... 17 more
Caused by: java.lang.RuntimeException: configuration exception
    at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:222)
    at org.apache.hadoop.streaming.PipeMapper.configure(PipeMapper.java:66)
    ... 22 more
Caused by: java.io.IOException: Cannot run program "/usr/local/hadoop/mapper.py": error=2, Aucun fichier ou dossier de ce type
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:209)
    ... 23 more
Caused by: java.io.IOException: error=2, Aucun fichier ou dossier de ce type
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
    at java.lang.ProcessImpl.start(ProcessImpl.java:134)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    ... 24 more

18/03/16 15:45:39 INFO mapreduce.Job: Task Id : attempt_1521211085961_0001_m_000000_0, Status : FAILED
Error: java.lang.RuntimeException: Error in configuring object

所以我查看了:http://172.30.10.64:8088/proxy/application_1521211085961_0001/

HTTP ERROR 500

Problem accessing /proxy/application_1521211085961_0001/. Reason:

    Connection to http://slave1:8088 refused

Caused by:

org.apache.http.conn.HttpHostConnectException: Connection to http://slave1:8088 refused

这很奇怪,因为我的两个数据节点都配置得很好(我可以ping,我可以通过ssh连接,...)

enter image description here

我的配置:

第一步:

/ etc / hosts在每个节点都很好:

  • 172.30.10.64 master
  • 172.30.10.72 slave1
  • 172.30.10.62 slave2

第二步:

/ etc / hostname在每个节点上都很好:

  • master for master node
  • slave1 for slave1 node
  • slave2 for slave2 node

第三步:

命令jps为我提供主节点:

4131 NameNode
4501 ResourceManager
5049 Jps
4347 SecondaryNameNode

和从属节点:

2357 DataNode
2491 NodeManager
2957 Jps

那么为什么我的namenode被拒绝连接到slave1?

修改

我2年前在Proxmox上安装了Hadoop 3个虚拟机以模拟每个节点,并启用了NAT模式。

现在,我正在使用VMWare VSphere而我没有NAT模式。

我的问题可能来自这个选项??

1 个答案:

答案 0 :(得分:0)

从你的jps输出中,我看到master上没有JobTracker而slave上没有TaskTracker。我想您可能忘记在主服务器上运行bin / start-mapred.sh,如果您已经运行它,那么我认为您需要在您的从服务器上检查/提供logs / hadoop-hduser-tasktracker-slave.log以查找错误。 还要检查此post以设置hadoop多节点群集 一步一步。