Hadoop启动dfs权限被拒绝为“hadoop”用户

时间:2014-03-31 16:09:46

标签: hadoop homebrew

我在mac local mac上设置了hadoop。当我使用start-dfs.sh命令使用单独的hadoop用户启动-dfs时,我在终端中收到以下错误。

0.0.0.0: mkdir: /usr/local/Cellar/hadoop/2.3.0/libexec/logs: Permission denied

有谁知道如何更改hadoop的日志目录?我用自制软件安装了hadoop。

bash-3.2$ start-dfs.sh  
14/03/31 09:04:20 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable  
Starting namenodes on [localhost]  
localhost: mkdir: /usr/local/Cellar/hadoop/2.3.0/libexec/logs: Permission denied  
localhost: chown: /usr/local/Cellar/hadoop/2.3.0/libexec/logs: No such file or directory  
localhost: starting namenode, logging to /usr/local/Cellar/hadoop/2.3.0/libexec/logs/hadoop-hadoop-namenode-mymac.local.out
localhost: /usr/local/Cellar/hadoop/2.3.0/libexec/sbin/hadoop-daemon.sh: line 151: /usr/local/Cellar/hadoop/2.3.0/libexec/logs/hadoop-hadoop-namenode-mymac.local.out: No such file or directory  
localhost: head: /usr/local/Cellar/hadoop/2.3.0/libexec/logs/hadoop-hadoop-namenode-mymac.local.out: No such file or directory
localhost: /usr/local/Cellar/hadoop/2.3.0/libexec/sbin/hadoop-daemon.sh: line 166: /usr/local/Cellar/hadoop/2.3.0/libexec/logs/hadoop-hadoop-namenode-mymac.local.out: No such file or directory
localhost: /usr/local/Cellar/hadoop/2.3.0/libexec/sbin/hadoop-daemon.sh: line 167: /usr/local/Cellar/hadoop/2.3.0/libexec/logs/hadoop-hadoop-namenode-mymac.local.out: No such file or directory
localhost: mkdir: /usr/local/Cellar/hadoop/2.3.0/libexec/logs: Permission denied
localhost: chown: /usr/local/Cellar/hadoop/2.3.0/libexec/logs: No such file or directory

1 个答案:

答案 0 :(得分:5)

错误表示权限问题。 hadoop用户需要hadoop文件夹的适当权限。尝试在终端中运行以下内容:

sudo chown -R hadoop /usr/local/Cellar/hadoop/2.3.0/