我正在运行一个Map reduce,它将扫描hbase并收集所需的数据。hadoop有7TB的数据,还有10TB的空闲空间。HBase中有大约2亿条记录。在完成99.44%的扫描HBase时,5个地图任务仍处于运行状态,完成率为0.0%。根本没有尝试这些过程。它将永远保持这种状态。因此,我的MR根本没有完成。当从我的本地机器上运行这个MR指向一张小桌子时,它运行得很好。有什么想法吗?为什么会卡住?如何解决?提前感谢
我在作业跟踪器日志中注意到的异常
2012-03-27 13:27:56,117 INFO org.apache.hadoop.mapred.JobInProgress: Choosing rack-local task task_201203271236_0001_m_000955
2012-03-27 13:27:56,699 INFO org.apache.hadoop.mapred.JobInProgress: Task 'attempt_201203271236_0001_m_000865_0' has completed task_201203271236_0001_m_000865 successfully.
2012-03-27 13:27:56,699 INFO org.apache.hadoop.mapred.ResourceEstimator: completedMapsUpdates:910 completedMapsInputSize:910 completedMapsOutputSize:60738755
2012-03-27 13:27:56,700 INFO org.apache.hadoop.mapred.JobInProgress: Choosing a non-local task task_201203271236_0001_m_000707
2012-03-27 13:27:56,700 INFO org.apache.hadoop.mapred.JobTracker: Adding task 'attempt_201203271236_0001_m_000707_0' to tip task_201203271236_0001_m_000707, for tracker 'tracker_nafhdi12809mwh.io.askjeeves.info:localhost.localdomain/127.0.0.1:55120'
2012-03-27 13:27:56,704 INFO org.apache.hadoop.ipc.Server: IPC Server handler 4 on 9001, call heartbeat(org.apache.hadoop.mapred.TaskTrackerStatus@17a323c0, false, false, true, 1022) from 10.76.99.112:49072: error: java.io.IOException: java.lang.NullPointerException
java.io.IOException: java.lang.NullPointerException
at org.apache.hadoop.mapred.JobInProgress.getMatchingLevelForNodes(JobInProgress.java:1235)
at org.apache.hadoop.mapred.JobInProgress.addRunningTaskToTIP(JobInProgress.java:1317)
at org.apache.hadoop.mapred.JobInProgress.obtainNewMapTask(JobInProgress.java:957)
at org.apache.hadoop.mapred.DefaultTaskSelector.obtainNewMapTask(DefaultTaskSelector.java:63)
at org.apache.hadoop.mapred.FairScheduler.assignTasks(FairScheduler.java:265)
at org.apache.hadoop.mapred.JobTracker.heartbeat(JobTracker.java:2586)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:508)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:961)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:957)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:955)
2012-03-27 13:27:56,713 INFO org.apache.hadoop.mapred.JobTracker: Adding task 'attempt_201203271236_0001_m_000865_1' to tip task_201203271236_0001_m_000865, for tracker 'tracker_nafhdi12809mwh.io.askjeeves.info:localhost.localdomain/127.0.0.1:55120'
2012-03-27 13:27:56,714 INFO org.apache.hadoop.mapred.JobInProgress: Choosing data-local task task_201203271236_0001_m_000865
2012-03-27 13:27:56,714 INFO org.apache.hadoop.mapred.JobTracker: Removed completed task 'attempt_201203271236_0001_m_000865_0' from 'tracker_nafhdi12809mwh.io.askjeeves.info:localhost.localdomain/127.0.0.1:55120'
2012-03-27 13:27:56,841 INFO org.apache.hadoop.mapred.JobInProgress: Task 'attempt_201203271236_0001_m_000877_0' has completed task_201203271236_0001_m_000877 successfully.
2012-03-27 13:27:56,841 INFO org.apache.hadoop.mapred.ResourceEstimator: completedMapsUpdates:911 completedMapsInputSize:911 completedMapsOutputSize:60800404
2012-03-27 13:27:56,842 INFO org.apache.hadoop.mapred.JobInProgress: Choosing a non-local task task_201203271236_0001_m_000753
2012-03-27 13:27:56,842 INFO org.apache.hadoop.mapred.JobTracker: Adding task 'attempt_201203271236_0001_m_000753_0' to tip task_201203271236_0001_m_000753, for tracker 'tracker_nafhdi12711mwh.io.askjeeves.info:localhost.localdomain/127.0.0.1:46050'
2012-03-27 13:27:56,842 INFO org.apache.hadoop.ipc.Server: IPC Server handler 3 on 9001, call heartbeat(org.apache.hadoop.mapred.TaskTrackerStatus@22911fb5, false, false, true, 1023) from 10.76.99.79:37228: error: java.io.IOException: java.lang.NullPointerException
java.io.IOException: java.lang.NullPointerException
您可以尝试运行hbase hbck
来查看您的表是否有任何问题
终于想通了。问题是topology.data文件,在从windows机器中移动文件时,windows字符被附加到了行的末尾。因此,在hadoop代码的getMatchingLevelForNodes()方法中,节点为null,因此发生了null指针异常。感谢大家的支持:)