我正在尝试运行hdfs,但是namenode还没有启动,我还尝试通过如下命令启动它
sudo -l /usr/hdp/hadoop/sbin/hadoop-daemon.sh --config /usr/hdp/hadoop/conf start namenode
但还没有开始。我查看了hadoop日志,发现以下错误:
错误
2015-04-28 10:36:04,752 FATAL namenode.NameNode (NameNode.java:main(1509)) - Failed to start namenode.java.io.FileNotFoundException: /hadoop/hdfs/namenode/in_use.lock (Permission denied)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:241)
at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.tryLock(Storage.java:706)
at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.lock(Storage.java:678)
at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.analyzeStorage(Storage.java:499)
at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverStorageDirs(FSImage.java:308)
at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:202)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:1022)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:741)at org.apache.hadoop.hdfs.server.namenode.NameNode.loadNamesystem(NameNode.java:536)
at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:595)
at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:762)
at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:746)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1438)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1504) 2015-04-28 10:36:04,755 INFO util.ExitUtil (ExitUtil.java:terminate(124)) - Exiting with status 1 2015-04-28 10:36:04,834 INFO namenode.NameNode (StringUtils.java:run(659)) - SHUTDOWN_MSG: /************************************************************
1条答案
按热度按时间oymdgrw71#
无法在java.io.randomaccessfile.open(本机方法)处启动namenode.java.io.filenotfoundexception:/hadoop/hdfs/namenode/in\u use.lock(权限被拒绝)
如果不以hadoop用户身份启动namenode,则可能会出现此错误。实际上,您正试图以root用户身份运行它,但是文件
/hadoop/hdfs/namenode/in_use.lock
属于hadoop用户。不要使用sudo启动hadoop进程。试着不用sudo启动它。试试这个: