我试图在ubuntu中设置单节点hadoop安装程序,当我运行hadoop namenode-format时,我遇到了一个错误“cannotdeleteedirectory/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条答案
按热度按时间6ie5vjzr1#
尝试以hduser身份从shell手动创建目录:hduser@ubuntu:mkdir/app/hadoop/tmp/dfs/name/current并发布错误。如果您得到“权限被拒绝”,张贴目录名,dfs和tmp的权利。