我在Running Hadoop on Ubuntu Linux(single node cluster)之后使用Hadoop 1.2.1创建了单节点集群。但是在尝试运行单节点集群时我发现错误无法启动tasktracker,因为在...上显示的java.lang.NullPointerException日志文件。我已阅读Hadoop tasktracker failed to start和unable to start jobtracker and tasktracker但我无法为我的案例找到解决方案。请帮我解决这个问题?可能是tasktracker.java源代码的问题是什么?任何我欣赏的想法。 Tasktracker日志文件:
2014-08-26 23:20:07,380 INFO org.apache.hadoop.mapred.TaskTracker: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting TaskTracker
STARTUP_MSG: host = ubuntu/127.0.1.1
STARTUP_MSG: args = []
STARTUP_MSG: version = 1.2.2-SNAPSHOT
STARTUP_MSG: build = -r ; compiled by 'dere' on Tue Aug 12 03:45:50 PDT 2014
STARTUP_MSG: java = 1.7.0_65
************************************************************/
2014-08-26 23:20:07,773 INFO org.apache.hadoop.metrics2.impl.MetricsConfig: loaded properties from hadoop-metrics2.properties
2014-08-26 23:20:07,861 INFO org.apache.hadoop.metrics2.impl.MetricsSourceAdapter: MBean for source MetricsSystem,sub=Stats registered.
2014-08-26 23:20:07,862 INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl: Scheduled snapshot period at 10 second(s).
2014-08-26 23:20:07,862 INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl: TaskTracker metrics system started
2014-08-26 23:20:07,876 ERROR org.apache.hadoop.mapred.TaskTracker: Can not start task tracker because java.lang.NullPointerException
at org.apache.hadoop.mapred.TaskTracker.<init>(TaskTracker.java:247)
at org.apache.hadoop.mapred.TaskTracker.main(TaskTracker.java:3965)
2014-08-26 23:20:07,876 INFO org.apache.hadoop.mapred.TaskTracker: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down TaskTracker at ubuntu/127.0.1.1
************************************************************/
芯-site.xml中
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>/app/hadoop/tmp</value>
<description>A base for other temporary directories.</description>
</property>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:54310</value>
<description>The name of the default file system. A URI whose
scheme and authority determine the FileSystem implementation. The
uri's scheme determines the config property (fs.SCHEME.impl) naming
the FileSystem implementation class. The uri's authority is used to
determine the host, port, etc. for a filesystem.</description>
</property>
</configuration>
HDFS-site.xml中
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
<description>Default block replication.
The actual number of replications can be specified when the file is created.
The default is used if replication is not specified in create time.
</description>
</property>
</configuration>
mapred-site.xml中
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:54311</value>
<description>The host and port that the MapReduce job tracker runs
at. If "local", then jobs are run in-process as a single map
and reduce task.
</description>
</property>
</configuration>
jps输出
dere@ubuntu:~/Desktop/hadoop-1.2.1/bin$ jps
3165 JobTracker
3370 Jps
3086 SecondaryNameNode
2766 NameNode
2911 DataNode