zoukankan      html  css  js  c++  java
  • Hadoop0.20.203.0在关机重启后,namenode启动报错(/dfs/name is in an inconsistent state)

    Hadoop0.20.203.0在关机重启后,namenode启动报错:

    1. 2011-10-21 05:22:20,504 INFO org.apache.hadoop.hdfs.server.common.Storage: Storage directory /tmp/hadoop-fzuir/dfs/name does not exist.
    2. 2011-10-21 05:22:20,506 ERROR org.apache.hadoop.hdfs.server.namenode.FSNamesystem: FSNamesystem initialization failed.
    3. org.apache.hadoop.hdfs.server.common.InconsistentFSStateException: Directory /tmp/hadoop-fzuir/dfs/name is in an inconsistent state: storage directory does not exist or is not accessible.
    4. at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:291)
    5. at org.apache.hadoop.hdfs.server.namenode.FSDirectory.loadFSImage(FSDirectory.java:97)
    6. at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.initialize(FSNamesystem.java:379)
    7. at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.<init>(FSNamesystem.java:353)
    8. at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:254)
    9. at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:434)
    10. at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1153)
    11. at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1162)


    这个以开始的解决方法是将namenode重新再format下,但是后面想想不对,这样每次都format,那不是玩完了~~

    然后就搜了下,发现是因为临时文件/tmp会被删除掉,解决方法就是修改core-site.xml,添加hadoop.tmp.dir属性:

    1. <property>
    2. <name>hadoop.tmp.dir</name>
    3. <value>/home/fzuir/Hadoop0.20.203.0/tmp/hadoop-${user.name}</value>
    4. </property>


    问题解决了,重启电脑后,再去启动hadoop就不会出现/dfs/name is in an inconsistent state的错误了~~

  • 相关阅读:
    Spring核心思想:IOC(控制反转)、DI(依赖注入)和AOP(面向切面编程)
    synchronized 与 lock锁的异同
    SpringMVC工作流程
    close()和flush()的区别
    MySQL—索引(Index)
    MySQL—事务(ACID)
    MySQL—存储引擎
    周学习笔记(16)——大三下
    周学习笔记(15)——大三下
    周学习笔记(14)——大三下
  • 原文地址:https://www.cnblogs.com/baoendemao/p/3804829.html
Copyright © 2011-2022 走看看