我在 mac 本地 mac 上安装了 hadoop。当我使用单独的 hadoop
用户使用 start-dfs.sh
命令启动 dfs 时,我在终端中收到以下错误。
0.0.0.0: mkdir:/usr/local/Cellar/hadoop/2.3.0/libexec/logs: 权限被拒绝
有谁知道如何更改 hadoop 的日志目录?我使用 Homebrew 软件安装了 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
最佳答案
该错误表明存在权限问题。 hadoop 用户需要 hadoop 文件夹的适当权限。尝试在终端中运行以下命令:
sudo chown -R hadoop /usr/local/Cellar/hadoop/2.3.0/
关于 "hadoop"用户的 Hadoop 启动 dfs 权限被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22766636/