无法删除目录/ app / hadoop / tmp / dfs / name / current

时间:2014-06-18 06:19:12

标签: hadoop

我正在尝试在Ubuntu中设置单节点hadoop设置,当我运行hadoop namenode -format时出现错误“无法删除目录/ app / hadoop / tmp / dfs / name / current”。我以root用户身份删除了当前目录,然后尝试了命令,然后得到了不同的错误,如下所示:

hduser@ubuntu:/usr/local/hadoop/bin$ hadoop namenode -format
14/06/17 22:58:46 INFO namenode.NameNode: STARTUP_MSG: 
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host = ubuntu/127.0.1.1
STARTUP_MSG:   args = [-format]
STARTUP_MSG:   version = 1.2.1
STARTUP_MSG:   build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.2 -r 1503152; compiled by 'mattf' on Mon Jul 22 15:23:09 PDT 2013
STARTUP_MSG:   java = 1.7.0_55
**************************************************
Re-format filesystem in /app/hadoop/tmp/dfs/name ? (Y or N) Y
14/06/17 22:58:49 INFO util.GSet: Computing capacity for map BlocksMap
14/06/17 22:58:49 INFO util.GSet: VM type       = 64-bit
14/06/17 22:58:49 INFO util.GSet: 2.0% max memory = 1013645312
14/06/17 22:58:49 INFO util.GSet: capacity      = 2^21 = 2097152 entries
14/06/17 22:58:49 INFO util.GSet: recommended=2097152, actual=2097152
14/06/17 22:58:51 INFO namenode.FSNamesystem: fsOwner=hduser
14/06/17 22:58:51 INFO namenode.FSNamesystem: supergroup=supergroup
14/06/17 22:58:51 INFO namenode.FSNamesystem: isPermissionEnabled=true
14/06/17 22:58:51 INFO namenode.FSNamesystem: dfs.block.invalidate.limit=100
14/06/17 22:58:51 INFO namenode.FSNamesystem: isAccessTokenEnabled=false accessKeyUpdateInterval=0 min(s), accessTokenLifetime=0 min(s)
14/06/17 22:58:51 INFO namenode.FSEditLog: dfs.namenode.edits.toleration.length = 0
14/06/17 22:58:51 INFO namenode.NameNode: Caching file names occuring more than 10 times 
14/06/17 22:58:52 ERROR namenode.NameNode: java.io.IOException: Cannot create directory /app/hadoop/tmp/dfs/name/current
    at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:294)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1337)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1356)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1261)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1467)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1488)

14/06/17 22:58:52 INFO namenode.NameNode: SHUTDOWN_MSG: 
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at ubuntu/127.0.1.1

然后我尝试使用sudo命令,我尝试访问hduser,但是没有用。

hduser@ubuntu:/usr/local/hadoop/bin$ sudo hadoop namenode -format
[sudo] password for hduser: 
sudo: hadoop: command not found

我尝试搜索解决方案并在conf / hdfs-site.xml中进行了更改但是没有用。 如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

尝试从shell手动创建目录作为hduser用户: hduser @ ubuntu:mkdir / app / hadoop / tmp / dfs / name / current 并发布错误。如果您获得“Permission denied”,请发布目录名称权限dfs和tmp。