异常笔记:Hadoop异常 namenode.NameNode: Encountered exception during format

 00:53:47,977 WARN namenode.NameNode: Encountered exception during format: 
java.io.IOException: Cannot remove current directory: /home/hadoop/tmp/dfs/name/current
    at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:433)
    at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:579)
    at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:601)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:173)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1190)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1631)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1741)
 00:53:47,979 ERROR namenode.NameNode: Failed to start namenode.
java.io.IOException: Cannot remove current directory: /home/hadoop/tmp/dfs/name/current
    at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:433)
    at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:579)
    at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:601)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:173)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1190)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1631)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1741)
 00:53:47,980 INFO util.ExitUtil: Exiting with status 1: java.io.IOException: Cannot remove current directory: /home/hadoop/tmp/dfs/name/current
 00:53:47,989 INFO namenode.NameNode: SHUTDOWN_MSG: 
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at localhost/127.0.0.1
************************************************************/

 

因为当前用户不是root,没有设置相关目录的权限 :


chown -R hadoop:hadoop /home/hadoop

sudo chmod -R a+w /usr/local/hadoop3.1.0

 

posted @ 2019-03-23 15:45  萧哥  阅读(1402)  评论(0编辑  收藏  举报