本文转自我的ChinaUnix博客: http://blog.chinaunix.net/u3/107162/showart_2204785.html
2010-03-29
环境已经搭好并可以启动了,如下:
- maohong@maohong-desktop:~/Software/Development/Hadoop/hadoop-0.20.2$ bin/start-all.sh
- starting namenode, logging to /home/maohong/Software/Development/Hadoop/hadoop-0.20.2/bin/../logs/hadoop-maohong-namenode-maohong-desktop.out
- slave1: starting datanode, logging to /home/maohong/Software/Development/Hadoop/hadoop-0.20.2/bin/../logs/hadoop-maohong-datanode-debian.out
- slave2: starting datanode, logging to /home/maohong/Software/Development/Hadoop/hadoop-0.20.2/bin/../logs/hadoop-maohong-datanode-node2.out
- master: starting datanode, logging to /home/maohong/Software/Development/Hadoop/hadoop-0.20.2/bin/../logs/hadoop-maohong-datanode-maohong-desktop.out
- master: starting secondarynamenode, logging to /home/maohong/Software/Development/Hadoop/hadoop-0.20.2/bin/../logs/hadoop-maohong-secondarynamenode-maohong-desktop.out
- starting jobtracker, logging to /home/maohong/Software/Development/Hadoop/hadoop-0.20.2/bin/../logs/hadoop-maohong-jobtracker-maohong-desktop.out
- slave1: starting tasktracker, logging to /home/maohong/Software/Development/Hadoop/hadoop-0.20.2/bin/../logs/hadoop-maohong-tasktracker-debian.out
- slave2: starting tasktracker, logging to /home/maohong/Software/Development/Hadoop/hadoop-0.20.2/bin/../logs/hadoop-maohong-tasktracker-node2.out
- master: starting tasktracker, logging to /home/maohong/Software/Development/Hadoop/hadoop-0.20.2/bin/../logs/hadoop-maohong-tasktracker-maohong-desktop.out
- maohong@maohong-desktop:~/Software/Development/Hadoop/hadoop-0.20.2$ jps
- 22565 SecondaryNameNode
- 22646 JobTracker
- 22342 DataNode
- 22907 Jps
- 22115 NameNode
- 22861 TaskTracker
但是执行wordcount程序到时候出现Error: java.lang.NullPointerException错误如下:
- maohong@maohong-desktop:~/Software/Development/Hadoop/hadoop-0.20.2$ bin/hadoop jar hadoop-0.20.2-examples.jar wordcount test-in test-out
- 10/03/25 19:40:05 INFO input.FileInputFormat: Total input paths to process : 4
- 10/03/25 19:40:05 INFO mapred.JobClient: Running job: job_201003251936_0001
- 10/03/25 19:40:06 INFO mapred.JobClient: map 0% reduce 0%
- 10/03/25 19:40:13 INFO mapred.JobClient: map 50% reduce 0%
- 10/03/25 19:40:14 INFO mapred.JobClient: map 100% reduce 0%
- 10/03/25 19:40:21 INFO mapred.JobClient: Task Id : attempt_201003251936_0001_r_000000_0, Status : FAILED
- Error: java.lang.NullPointerException
- at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768)
- at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$GetMapEventsThread.getMapCompletionEvents(ReduceTask.java:2683)
- at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$GetMapEventsThread.run(ReduceTask.java:2605)
- 10/03/25 19:40:21 WARN mapred.JobClient: Error reading task outputhttp://localhost:50060/tasklog?plaintext=true&taskid=attempt_201003251936_0001_r_000000_0&filter=stdout
- 10/03/25 19:40:21 WARN mapred.JobClient: Error reading task outputhttp://localhost:50060/tasklog?plaintext=true&taskid=attempt_201003251936_0001_r_000000_0&filter=stderr
- 10/03/25 19:40:27 INFO mapred.JobClient: Task Id : attempt_201003251936_0001_r_000000_1, Status : FAILED
- Error: java.lang.NullPointerException
- at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768)
- at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$GetMapEventsThread.getMapCompletionEvents(ReduceTask.java:2683)
- at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$GetMapEventsThread.run(ReduceTask.java:2605)
- 10/03/25 19:40:27 WARN mapred.JobClient: Error reading task outputnode2.1036dhcp
- 10/03/25 19:40:27 WARN mapred.JobClient: Error reading task outputnode2.1036dhcp
- 10/03/25 19:40:36 INFO mapred.JobClient: Task Id : attempt_201003251936_0001_r_000000_2, Status : FAILED
- Error: java.lang.NullPointerException
- at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768)
- at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$GetMapEventsThread.getMapCompletionEvents(ReduceTask.java:2683)
- at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$GetMapEventsThread.run(ReduceTask.java:2605)
- 10/03/25 19:40:45 INFO mapred.JobClient: Job complete: job_201003251936_0001
- 10/03/25 19:40:45 INFO mapred.JobClient: Counters: 12
- 10/03/25 19:40:45 INFO mapred.JobClient: Job Counters
- 10/03/25 19:40:45 INFO mapred.JobClient: Launched reduce tasks=4
- 10/03/25 19:40:45 INFO mapred.JobClient: Launched map tasks=4
- 10/03/25 19:40:45 INFO mapred.JobClient: Data-local map tasks=4
- 10/03/25 19:40:45 INFO mapred.JobClient: Failed reduce tasks=1
- 10/03/25 19:40:45 INFO mapred.JobClient: FileSystemCounters
- 10/03/25 19:40:45 INFO mapred.JobClient: HDFS_BYTES_READ=8637
- 10/03/25 19:40:45 INFO mapred.JobClient: FILE_BYTES_WRITTEN=11495
- 10/03/25 19:40:45 INFO mapred.JobClient: Map-Reduce Framework
- 10/03/25 19:40:45 INFO mapred.JobClient: Combine output records=900
- 10/03/25 19:40:45 INFO mapred.JobClient: Map input records=83
- 10/03/25 19:40:45 INFO mapred.JobClient: Spilled Records=900
- 10/03/25 19:40:45 INFO mapred.JobClient: Map output bytes=14697
- 10/03/25 19:40:45 INFO mapred.JobClient: Combine input records=1525
- 10/03/25 19:40:45 INFO mapred.JobClient: Map output records=1525
- maohong@maohong-desktop:~/Software/Development/Hadoop/hadoop-0.20.2$
jobtracker的log文件如下:
- 2010-03-25 19:40:09,447 INFO org.apache.hadoop.mapred.JobInProgress: Choosing data-local task task_201003251936_0001_m_000003
- 2010-03-25 19:40:12,268 INFO org.apache.hadoop.mapred.JobInProgress: Task 'attempt_201003251936_0001_m_000000_0' has completed task_201003251936_0001_m_000000 successfully.
- 2010-03-25 19:40:12,268 INFO org.apache.hadoop.mapred.ResourceEstimator: completedMapsUpdates:1 completedMapsInputSize:4275 completedMapsOutputSize:5190
- 2010-03-25 19:40:12,271 INFO org.apache.hadoop.mapred.JobInProgress: Task 'attempt_201003251936_0001_m_000001_0' has completed task_201003251936_0001_m_000001 successfully.
- 2010-03-25 19:40:12,271 INFO org.apache.hadoop.mapred.ResourceEstimator: completedMapsUpdates:2 completedMapsInputSize:5745 completedMapsOutputSize:7302
- 2010-03-25 19:40:12,288 INFO org.apache.hadoop.mapred.JobTracker: Adding task 'attempt_201003251936_0001_r_000000_0' to tip task_201003251936_0001_r_000000, for tracker 'tracker_localhost:localhost/127.0.0.1:38831'
- 2010-03-25 19:40:12,522 INFO org.apache.hadoop.mapred.JobInProgress: Task 'attempt_201003251936_0001_m_000002_0' has completed task_201003251936_0001_m_000002 successfully.
- 2010-03-25 19:40:12,522 INFO org.apache.hadoop.mapred.ResourceEstimator: completedMapsUpdates:3 completedMapsInputSize:7215 completedMapsOutputSize:9414
- 2010-03-25 19:40:12,524 INFO org.apache.hadoop.mapred.JobInProgress: Task 'attempt_201003251936_0001_m_000003_0' has completed task_201003251936_0001_m_000003 successfully.
- 2010-03-25 19:40:12,524 INFO org.apache.hadoop.mapred.ResourceEstimator: completedMapsUpdates:4 completedMapsInputSize:8641 completedMapsOutputSize:11367
- 2010-03-25 19:40:18,300 INFO org.apache.hadoop.mapred.TaskInProgress: Error from attempt_201003251936_0001_r_000000_0: Error: java.lang.NullPointerException
- at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768)
- at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$GetMapEventsThread.getMapCompletionEvents(ReduceTask.java:2683)
- at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$GetMapEventsThread.run(ReduceTask.java:2605)
- 2010-03-25 19:40:18,301 INFO org.apache.hadoop.mapred.JobTracker: Adding task (cleanup)'attempt_201003251936_0001_r_000000_0' to tip task_201003251936_0001_r_000000, for tracker 'tracker_localhost:localhost/127.0.0.1:38831'
- 2010-03-25 19:40:21,307 INFO org.apache.hadoop.mapred.JobTracker: Removed completed task 'attempt_201003251936_0001_r_000000_0' from 'tracker_localhost:localhost/127.0.0.1:38831'
- 2010-03-25 19:40:21,559 INFO org.apache.hadoop.mapred.JobTracker: Adding task 'attempt_201003251936_0001_r_000000_1' to tip task_201003251936_0001_r_000000, for tracker 'tracker_node2.1036dhcp:localhost/127.0.0.1:59187'
- 2010-03-25 19:40:24,599 INFO org.apache.hadoop.mapred.TaskInProgress: Error from attempt_201003251936_0001_r_000000_1: Error: java.lang.NullPointerException
- at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768)
- at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$GetMapEventsThread.getMapCompletionEvents(ReduceTask.java:2683)
- at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$GetMapEventsThread.run(ReduceTask.java:2605)
- 2010-03-25 19:40:24,600 INFO org.apache.hadoop.mapred.JobTracker: Adding task (cleanup)'attempt_201003251936_0001_r_000000_1' to tip task_201003251936_0001_r_000000, for tracker 'tracker_node2.1036dhcp:localhost/127.0.0.1:59187'
- 2010-03-25 19:40:27,607 INFO org.apache.hadoop.mapred.JobTracker: Removed completed task 'attempt_201003251936_0001_r_000000_1' from 'tracker_node2.1036dhcp:localhost/127.0.0.1:59187'
- 2010-03-25 19:40:30,201 INFO org.apache.hadoop.mapred.JobTracker: Adding task 'attempt_201003251936_0001_r_000000_2' to tip task_201003251936_0001_r_000000, for tracker 'tracker_maohong-desktop:localhost/127.0.0.1:60931'
- 2010-03-25 19:40:33,260 INFO org.apache.hadoop.mapred.TaskInProgress: Error from attempt_201003251936_0001_r_000000_2: Error: java.lang.NullPointerException
- at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768)
- at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$GetMapEventsThread.getMapCompletionEvents(ReduceTask.java:2683)
- at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$GetMapEventsThread.run(ReduceTask.java:2605)
- 2010-03-25 19:40:33,261 INFO org.apache.hadoop.mapred.JobTracker: Adding task (cleanup)'attempt_201003251936_0001_r_000000_2' to tip task_201003251936_0001_r_000000, for tracker 'tracker_maohong-desktop:localhost/127.0.0.1:60931'
- 2010-03-25 19:40:36,266 INFO org.apache.hadoop.mapred.JobTracker: Adding task 'attempt_201003251936_0001_r_000000_3' to tip task_201003251936_0001_r_000000, for tracker 'tracker_maohong-desktop:localhost/127.0.0.1:60931'
- 2010-03-25 19:40:36,266 INFO org.apache.hadoop.mapred.JobTracker: Removed completed task 'attempt_201003251936_0001_r_000000_2' from 'tracker_maohong-desktop:localhost/127.0.0.1:60931'
- 2010-03-25 19:40:39,270 INFO org.apache.hadoop.mapred.TaskInProgress: Error from attempt_201003251936_0001_r_000000_3: Error: java.lang.NullPointerException
- at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768)
- at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$GetMapEventsThread.getMapCompletionEvents(ReduceTask.java:2683)
- at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$GetMapEventsThread.run(ReduceTask.java:2605)
- 2010-03-25 19:40:39,271 INFO org.apache.hadoop.mapred.JobTracker: Adding task (cleanup)'attempt_201003251936_0001_r_000000_3' to tip task_201003251936_0001_r_000000, for tracker 'tracker_maohong-desktop:localhost/127.0.0.1:60931'
- 2010-03-25 19:40:42,278 INFO org.apache.hadoop.mapred.TaskInProgress: TaskInProgress task_201003251936_0001_r_000000 has failed 4 times.
- 2010-03-25 19:40:42,278 INFO org.apache.hadoop.mapred.JobInProgress: Aborting job job_201003251936_0001
- 2010-03-25 19:40:42,279 INFO org.apache.hadoop.mapred.JobInProgress: Killing job 'job_201003251936_0001'
- 2010-03-25 19:40:42,279 INFO org.apache.hadoop.mapred.JobTracker: Adding task 'attempt_201003251936_0001_m_000004_0' to tip task_201003251936_0001_m_000004, for tracker 'tracker_maohong-desktop:localhost/127.0.0.1:60931'
- 2010-03-25 19:40:42,279 INFO org.apache.hadoop.mapred.JobTracker: Removed completed task 'attempt_201003251936_0001_r_000000_3' from 'tracker_maohong-desktop:localhost/127.0.0.1:60931'
- 2010-03-25 19:40:45,288 INFO org.apache.hadoop.mapred.JobInProgress: Task 'attempt_201003251936_0001_m_000004_0' has completed task_201003251936_0001_m_000004 successfully.
- 2010-03-25 19:40:45,333 INFO org.apache.hadoop.mapred.JobTracker: Removed completed task 'attempt_201003251936_0001_m_000004_0' from 'tracker_maohong-desktop:localhost/127.0.0.1:60931'
- 2010-03-25 19:40:45,333 INFO org.apache.hadoop.mapred.JobTracker: Removed completed task 'attempt_201003251936_0001_r_000000_2' from 'tracker_maohong-desktop:localhost/127.0.0.1:60931'
- 2010-03-25 19:40:45,334 INFO org.apache.hadoop.mapred.JobTracker: Removed completed task 'attempt_201003251936_0001_r_000000_3' from 'tracker_maohong-desktop:localhost/127.0.0.1:60931'
- 2010-03-25 19:40:45,334 INFO org.apache.hadoop.mapred.JobTracker: Removed completed task 'attempt_201003251936_0001_m_000000_0' from 'tracker_localhost:localhost/127.0.0.1:38831'
- 2010-03-25 19:40:45,334 INFO org.apache.hadoop.mapred.JobTracker: Removed completed task 'attempt_201003251936_0001_m_000001_0' from 'tracker_localhost:localhost/127.0.0.1:38831'
- 2010-03-25 19:40:45,334 INFO org.apache.hadoop.mapred.JobTracker: Removed completed task 'attempt_201003251936_0001_m_000005_0' from 'tracker_localhost:localhost/127.0.0.1:38831'
- 2010-03-25 19:40:45,335 INFO org.apache.hadoop.mapred.JobTracker: Removed completed task 'attempt_201003251936_0001_r_000000_0' from 'tracker_localhost:localhost/127.0.0.1:38831'
- 2010-03-25 19:40:45,694 INFO org.apache.hadoop.mapred.JobTracker: Removed completed task 'attempt_201003251936_0001_m_000002_0' from 'tracker_node2.1036dhcp:localhost/127.0.0.1:59187'
- 2010-03-25 19:40:45,694 INFO org.apache.hadoop.mapred.JobTracker: Removed completed task 'attempt_201003251936_0001_m_000003_0' from 'tracker_node2.1036dhcp:localhost/127.0.0.1:59187'
- 2010-03-25 19:40:45,694 INFO org.apache.hadoop.mapred.JobTracker: Removed completed task 'attempt_201003251936_0001_r_000000_1' from 'tracker_node2.1036dhcp:localhost/127.0.0.1:59187'
其中一个tasktracker的log如下,另外两个tasktracker的log也有与此同样的错误:
- 2010-03-25 19:40:30,249 INFO org.apache.hadoop.mapred.TaskTracker: Trying to launch : attempt_201003251936_0001_r_000000_2
- 2010-03-25 19:40:30,249 INFO org.apache.hadoop.mapred.TaskTracker: In TaskLauncher, current free slots : 2 and trying to launch attempt_201003251936_0001_r_000000_2
- 2010-03-25 19:40:30,587 INFO org.apache.hadoop.mapred.JvmManager: In JvmRunner constructed JVM ID: jvm_201003251936_0001_r_1711860611
- 2010-03-25 19:40:30,588 INFO org.apache.hadoop.mapred.JvmManager: JVM Runner jvm_201003251936_0001_r_1711860611 spawned.
- 2010-03-25 19:40:31,057 INFO org.apache.hadoop.mapred.TaskTracker: JVM with ID: jvm_201003251936_0001_r_1711860611 given task: attempt_201003251936_0001_r_000000_2
- 2010-03-25 19:40:31,437 FATAL org.apache.hadoop.mapred.TaskTracker: Task: attempt_201003251936_0001_r_000000_2 - Killed : java.lang.NullPointerException
- at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768)
- at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$GetMapEventsThread.getMapCompletionEvents(ReduceTask.java:2683)
- at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$GetMapEventsThread.run(ReduceTask.java:2605)
问题的原因在于master和slave节点的/etc/hosts文件~~~~~~
/etc/hosts文件中的主机名一定要是机器名,而不是master、slave1、slave2,否则不能正确解析。这就是结症所在!
改了之后就解决了,呵呵
相关推荐
1. "hadoop安装实例(原创最终版).doc":这可能是一个详细的Hadoop安装步骤文档,包括了从下载源码到编译、安装、配置的全过程,可能还包含了遇到问题时的解决方案。 2. "细细品味Hadoop_Hadoop集群(第1期)_...
YARN是HADOOP的资源管理器,负责管理HADOOP集群中计算资源的分配。 1.2 HADOOP产生背景 HADOOP的产生背景是大数据时代的到来,随着数据量的急剧增长,传统的数据处理方式无法满足需求,HADOOP的出现解决了这个问题...
【大数据技术基础实验报告-Linux环境下hadoop...完成上述步骤后,一个基本的Hadoop集群就在Linux环境中搭建起来了,能够进行大数据的存储和处理。在实际应用中,还需考虑高可用性、性能优化以及安全策略等方面的配置。
Hadoop伪分布式集群环境搭建,有常见错误及解决方案。
### 基于Windows的Hadoop集群搭建图文教程 #### 一、引言与背景介绍 随着大数据技术的发展,Hadoop作为一个重要的分布式处理框架,在数据分析领域占据着举足轻重的地位。然而,对于初学者而言,尤其是在Windows...
Hadoop是一个开源的、可运行与Linux集群上的分布式计算平台,用户可借助Hadoop存有基础环境的配置(虚拟机安装、Linux安装等),Hadoop集群搭建,配置和测试。 一、虚拟机的安装 VMware (Virtual Machine...
标题中提到的“02Hadoop集群搭建.pdf”指的是关于Hadoop集群安装的电子文档或教程,它涉及到如何搭建一个Hadoop集群的知识。Hadoop集群搭建对于理解其内部结构和工作原理至关重要,因为它是由多个计算机节点组成的...
搭建Hadoop集群是大数据处理的基础工作,涉及到多台服务器之间的协同工作。在这个过程中,我们通常会设置一个NameNode作为主节点,...遇到问题时,根据日志信息和常见错误的解决方案进行排查,通常都能找到问题的根源。
7. Linux操作系统在大数据处理中的应用:Linux操作系统是大数据处理中的一种常见的解决方案,提供了一个稳定、安全的环境,可以满足大数据处理的需求。 8. 虚拟化技术在大数据处理中的应用:虚拟化技术可以解决大...
五、Linux环境下的Hadoop集群搭建 1. 安装Java环境:Hadoop依赖Java运行,因此首先需在所有节点上安装Java开发套件(JDK)。 2. 安装配置Hadoop:下载Hadoop源码或二进制包,然后根据集群规模进行配置,包括设置...
- 在Vmware中创建一个新的虚拟机,并选择合适的Linux发行版(如CentOS 64位),按照提示完成操作系统安装。 - 安装完成后,需要配置网络参数以确保虚拟机能够访问互联网。具体步骤包括: - 关闭DHCP服务。 - ...
为了在VMware Workstation 16中搭建Hadoop集群,首先需要准备安装虚拟机软件的高性能计算机,然后在该计算机上安装Linux系统,创建多台虚拟机,再让这些虚拟机构成一个局域网络。这样,你就可以在这个内部网络上安装...
2、采用hadoop2.0官方提供QJM —HDFS,HA的解决方案,在QJM方案中,主备NameNode之间通过一组JournalNode同步元数据信息。 3、这里还配置了一个zookeeper集群,用于ZKFC(DFSZKFailoverController)故障转移,当...
本篇文章将详细解析Hadoop伪分布式集群环境的搭建步骤,以及在搭建过程中可能遇到的问题及其解决方案。 首先,我们需要在虚拟机中准备好Hadoop的安装包。这里以Hadoop 2.5.0-cdh5.3.6为例,将其解压至/usr/iflytek...
5. **EMC的统一数据存储和分析平台**:EMC利用Hadoop建立了一个综合性的数据存储和分析解决方案,帮助企业更好地管理和分析数据。 #### 四、结语 Hadoop作为大数据领域的关键技术之一,为企业提供了强大的数据处理...