在运行MapReduce jar时,我遇到以下异常:
Exception in thread "main" org.apache.hadoop.ipc.RemoteException: org.apache.hadoop.mapred.JobTrackerNotYetInitializedException: JobTracker is not yet RUNNING
at org.apache.hadoop.mapred.JobTracker.checkJobTrackerState(JobTracker.java:5199)
at org.apache.hadoop.mapred.JobTracker.getNewJobId(JobTracker.java:3543)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:587)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1432)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1428)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1426)
at org.apache.hadoop.ipc.Client.call(Client.java:1113)
at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:229)
at org.apache.hadoop.mapred.$Proxy2.getNewJobId(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:85)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:62)
at org.apache.hadoop.mapred.$Proxy2.getNewJobId(Unknown Source)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:944)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:936)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:936)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:550)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:580)
at com.sreejithpillai.excel.mapreduce.ExcelDriver.main(ExcelDriver.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.main(RunJar.java:160)
但jps
命令显示
15575 JobTracker
15471 SecondaryNameNode
15137 NameNode
16123 Jps
15733 TaskTracker
3720
我尝试格式化namenode并重新启动,但问题仍然存在。
我可以在http://localhost:50030/jobtracker.jsp
看到工作有人请帮忙。
答案 0 :(得分:0)
从问题不清楚是否已重新启动jobtracker(格式化namenode之后)。
如果重新启动namenode,最好重新启动jobtracker。即使jps显示进程正在运行,但它可能是不一致的状态。您需要转到jobtracker日志并检查是否有任何错误
答案 1 :(得分:0)
你使用什么样的配置?独立模式,伪群集模式还是完全分布模式?还运行hadoop fsck /
以检查hdfs是处于健康状态还是处于损坏状态(当多个商用计算机远程访问时,主要适用于伪群集)
[edureka@localhost ~]$ hadoop fsck /
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.
15/12/03 11:07:58 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Connecting to namenode via http://localhost:50070
FSCK started by edureka (auth:SIMPLE) from /127.0.0.1 for path / at Thu Dec 03 11:07:58 IST 2015
....................................................................................................
................................................
/tmp/hadoop-yarn/staging/edureka/.staging/job_1448946364079_0184/job.jar: Under replicated BP-1756909416-127.0.0.1-1411538715533:blk_1073781438_40623. Target Replicas is 10 but found 1 replica(s).
.
/tmp/hadoop-yarn/staging/edureka/.staging/job_1448946364079_0184/job.split: Under replicated BP-1756909416-127.0.0.1-1411538715533:blk_1073781439_40624. Target Replicas is 10 but found 1 replica(s).
...
/tmp/hadoop-yarn/staging/edureka/.staging/job_1448946364079_0261/job.jar: Under replicated BP-1756909416-127.0.0.1-1411538715533:blk_1073782193_41378. Target Replicas is 10 but found 1 replica(s).
.
/tmp/hadoop-yarn/staging/edureka/.staging/job_1448946364079_0261/job.split: Under replicated BP-1756909416-127.0.0.1-1411538715533:blk_1073782194_41379. Target Replicas is 10 but found 1 replica(s).
...
/tmp/hadoop-yarn/staging/edureka/.staging/job_1448946364079_0282/job.jar: Under replicated BP-1756909416-127.0.0.1-1411538715533:blk_1073782396_41581. Target Replicas is 10 but found 1 replica(s).
.
/tmp/hadoop-yarn/staging/edureka/.staging/job_1448946364079_0282/job.split: Under replicated BP-1756909416-127.0.0.1-1411538715533:blk_1073782397_41582. Target Replicas is 10 but found 1 replica(s).
...........................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
..Status: HEALTHY
Total size: 131322862 B
Total dirs: 138
Total files: 902
Total symlinks: 0
Total blocks (validated): 825 (avg. block size 159179 B)
Minimally replicated blocks: 825 (100.0 %)
Over-replicated blocks: 0 (0.0 %)
Under-replicated blocks: 6 (0.72727275 %)
Mis-replicated blocks: 0 (0.0 %)
Default replication factor: 1
Average block replication: 1.0
Corrupt blocks: 0
Missing replicas: 54 (6.143345 %)
Number of data-nodes: 1
Number of racks: 1
FSCK ended at Thu Dec 03 11:07:59 IST 2015 in 130 milliseconds
The filesystem under path '/' is HEALTHY
我正在使用伪群集模式 ,目前有17台机器正在访问它。不知何故,当安装了VM的机器的4个核心无法提供足够的CPU来运行作业时。 hdfs被破坏了。当VM出现过载时会发生这种情况。
请指定您正在使用的配置。