namenode沒法啓動:java.io.FileNotFoundException: .log (Permission denied)

在啓動集羣的時候,namenode沒法啓動,用tail命令查看log,能夠看到出現以下錯誤:java

[hadoop@master hadoop]$ tail -100f /usr/local/hadoop/libexec/../logs/hadoop-hadoop-namenode-master.out
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: /usr/local/hadoop/libexec/../logs/hadoop-hadoop-namenode-master.log (Permission denied)


能夠看到node

hadoop-hadoop-namenode-master.log

文件權限受限。
bash

定位到logs目錄下:ide

[hadoop@master libexec]$ cd /usr/local/hadoop/libexec/../logs/
[hadoop@master logs]$ ls
hadoop-hadoop-datanode-master.log
hadoop-hadoop-datanode-master.log.2014-04-20
hadoop-hadoop-datanode-master.log.2014-04-21
hadoop-hadoop-datanode-master.log.2014-04-22
hadoop-hadoop-datanode-master.log.2014-04-23
hadoop-hadoop-datanode-master.log.2014-04-24
hadoop-hadoop-datanode-master.log.2014-04-26
hadoop-hadoop-datanode-master.log.2014-04-29
hadoop-hadoop-datanode-master.log.2014-04-30
hadoop-hadoop-datanode-master.log.2014-05-01
hadoop-hadoop-datanode-master.log.2014-05-02
hadoop-hadoop-datanode-master.log.2014-05-03
hadoop-hadoop-datanode-master.log.2014-05-04
hadoop-hadoop-datanode-master.log.2014-05-11
hadoop-hadoop-datanode-master.out

再切換到root權限,執行下列修改權限命令:oop

[hadoop@master logs]$ su root
Password: 
[root@master logs]# chmod 777 hadoop-hadoop-namenode-master.log

此時再用jps查看下,namenode已經啓動起來了.hadoop

[root@master hadoop]# jpsit

23714 NameNodeio

26578 Jpsast

24633 JobTrackerclass

26284 TaskTracker

26040 DataNode


OK,大功告成!

相關文章
相關標籤/搜索