执行hadoop jar时出现错误./hadoop-examples-1.0.3.jar pi 2 5

时间:2014-12-07 20:06:27

标签: hadoop

当我尝试hadoop jar ./hadoop-examples-1.0.3.jar pi 2 5.它显示以下错误。

hduser@ubuntu:/usr/local/hadoop-1.0.3$ hadoop jar ./hadoop-examples-1.0.3.jar pi 2 5
Warning: $HADOOP_HOME is deprecated.

Number of Maps  = 2
Samples per Map = 5
Wrote input for Map #0 
Wrote input for Map #1
Starting Job
14/12/07 09:47:33 INFO ipc.Client: Retrying connect to server: 172.16.76.1/172.16.76.1:9002. Already tried 0 time(s).
14/12/07 09:47:54 INFO ipc.Client: Retrying connect to server: 172.16.76.1/172.16.76.1:9002. Already tried 1 time(s).
^C^Chduser@ubuntu:/usr/local/hadoop-1.0.3$ 


hduser@ubuntu:~/data/dfs$ jps
7176 DataNode
7484 JobTracker
6960 NameNode
7704 TaskTracker
7400 SecondaryNameNode
7766 Jps
hduser@ubuntu:~/data/dfs$ cd /usr/local/hadoop-1.0.3/

As you can see that all the processes are running.But when I go to log I found the below error;


ERROR org.apache.hadoop.hdfs.server.namenode.FSNamesystem: FSNamesystem initialization failed.
org.apache.hadoop.hdfs.server.common.InconsistentFSStateException: Directory /home/hduser/data/dfs/namenode is in an inconsistent state: storage directory does not exist or is not accessible.

I checked my .xml files configuration.Which is as follows;

mapre-site.xml

<property>
  <name>mapred.job.tracker</name>
  <value>172.16.76.1:9002</value>
</property>

core-site.xml

 <property>
   <name>fs.default.name</name>
   <value>hdfs://localhost:9001</value>
 </property> 

HDFS-site.xml中

<property>
   <name>dfs.name.dir</name>
   <value>/home/hduser/data/dfs/namenode</value>
</property>

<property>
   <name>dfs.data.dir</name>
   <value>/home/hduser/data/dfs/datanode</value>
</property>

<property>    
  <name>dfs.replication</name>
  <value>1</value>
</property>

我尝试格式化namenode并重新开始。但没有任何反应。 我将目录所有者权限更改为755并再次尝试但问题仍未解决 解决问题。
我筋疲力尽所有在这个博客上给出的建议,它没有帮助。 我虽然所有可能的解决方案并尝试了所以可能有时间解决它但仍然无法做到 同样的问题一次又一次地出现。 这是详细的错误消息:

2014-12-07 06:25:05,376 INFO org.apache.hadoop.hdfs.server.common.Storage: Storage directory 

/home/hduser/data/dfs/namenode does not exist.
2014-12-07 06:25:05,377 ERROR org.apache.hadoop.hdfs.server.namenode.FSNamesystem: FSNamesystem initialization failed.
org.apache.hadoop.hdfs.server.common.InconsistentFSStateException: Directory /home/hduser/data/dfs/namenode is in an inconsistent state: storage directory does not exist or is not accessible.
        at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:303)
        at org.apache.hadoop.hdfs.server.namenode.FSDirectory.loadFSImage(FSDirectory.java:100)
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.initialize(FSNamesystem.java:388)
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.<init>(FSNamesystem.java:362)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:276)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:496)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1279)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1288)
2014-12-07 06:25:05,399 ERROR org.apache.hadoop.hdfs.server.namenode.NameNode: org.apache.hadoop.hdfs.server.common.InconsistentFSStateException: Directory /home/hduser/data/dfs/namenode is in an inconsistent state: storage directory does not exist or is not accessible.
        at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:303)
        at org.apache.hadoop.hdfs.server.namenode.FSDirectory.loadFSImage(FSDirectory.java:100)
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.initialize(FSNamesystem.java:388)
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.<init>(FSNamesystem.java:362)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:276)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:496)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1279)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1288)
2014-12-07 06:25:05,407 INFO org.apache.hadoop.hdfs.server.namenode.NameNode: SHUTDOWN_MSG:

1 个答案:

答案 0 :(得分:0)

您可以尝试删除namenode存储目录/ home / hduser / data / dfs / namenode,然后格式化namenode吗?