Hadoop:start-dfs.sh权限被拒绝

Mun*_*ong 16 hadoop

我正在我的笔记本电脑上安装Hadoop.SSH工作正常,但我无法启动hadoop.

munichong@GrindPad:~$ ssh localhost
Welcome to Ubuntu 12.10 (GNU/Linux 3.5.0-25-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

0 packages can be updated.
0 updates are security updates.

Last login: Mon Mar  4 00:01:36 2013 from localhost

munichong@GrindPad:~$ /usr/sbin/start-dfs.sh
chown: changing ownership of `/var/log/hadoop/root': Operation not permitted
starting namenode, logging to /var/log/hadoop/root/hadoop-munichong-namenode-GrindPad.out
/usr/sbin/hadoop-daemon.sh: line 136: /var/run/hadoop/hadoop-munichong-namenode.pid: Permission denied
usr/sbin/hadoop-daemon.sh: line 135: /var/log/hadoop/root/hadoop-munichong-namenode-GrindPad.out: Permission denied
head: cannot open `/var/log/hadoop/root/hadoop-munichong-namenode-GrindPad.out' for reading: No such file or directory
localhost: chown: changing ownership of `/var/log/hadoop/root': Operation not permitted
localhost: starting datanode, logging to /var/log/hadoop/root/hadoop-munichong-datanode-GrindPad.out
localhost: /usr/sbin/hadoop-daemon.sh: line 135: /var/log/hadoop/root/hadoop-munichong-datanode-GrindPad.out: Permission denied
localhost: /usr/sbin/hadoop-daemon.sh: line 136: /var/run/hadoop/hadoop-munichong-datanode.pid: Permission denied
localhost: head: cannot open `/var/log/hadoop/root/hadoop-munichong-datanode-GrindPad.out' for reading: No such file or directory
localhost: chown: changing ownership of `/var/log/hadoop/root': Operation not permitted
localhost: starting secondarynamenode, logging to /var/log/hadoop/root/hadoop-munichong-secondarynamenode-GrindPad.out
localhost: /usr/sbin/hadoop-daemon.sh: line 136: /var/run/hadoop/hadoop-munichong-secondarynamenode.pid: Permission denied
localhost: /usr/sbin/hadoop-daemon.sh: line 135: /var/log/hadoop/root/hadoop-munichong-secondarynamenode-GrindPad.out: Permission denied
localhost: head: cannot open `/var/log/hadoop/root/hadoop-munichong-secondarynamenode-GrindPad.out' for reading: No such file or directory

munichong@GrindPad:~$ sudo /usr/sbin/start-dfs.sh
[sudo] password for munichong: 
starting namenode, logging to /var/log/hadoop/root/hadoop-root-namenode-GrindPad.out
localhost: Permission denied (publickey,password).
localhost: Permission denied (publickey,password).
Run Code Online (Sandbox Code Playgroud)

我用过"sudo".但许可仍被拒绝.

有没有人可以帮助我?

提前致谢!

小智 28

我在最后几个小时遇到了同样的问题,但终于解决了.我有同一个用户提取的hadoop安装,就像我用来运行hadoop一样.因此用户权限不是问题.
我的配置是这样的:Google Cloud上的Ubuntu linux机器.

Hadoop安装/ home/Hadoop数据目录/ var/lib/hadoop和目录访问位是777所以任何人都可以访问.我做了ssh进入远程机器对配置文件进行了更改并执行了start-dfs.sh,然后它给了我"权限被拒绝(公钥)"所以这里是解决方案:在同一个ssh终端:

  1. SSH-凯基

2.它会询问文件夹位置,它会复制密钥,我输入了/home/hadoop/.ssh/id_rsa

3.它会要求密码,为简单起见,请保持空白.

4. cat /home/hadoop/.ssh/id_rsa.pub >> .ssh/authorized_keys (将新生成的公钥复制到用户home/.ssh目录中的auth文件)

  1. ssh localhost

  2. start-dfs.sh (现在应该可以了!)

  • 我可以毫无问题地运行`ssh localhost`或提示输入密码。但是我仍然无法运行start-dfs.sh (2认同)

小智 15

我遇到了同样的问题,所以试图连接SSH并获得" 未找到 "之类的声明,所以我通过以下步骤进入ssh位置进行调试:

cd ~/.ssh

ssh_keygen -t rsa -p""

cat id_rsa.pub >> authorized_keys

......然后它起作用了......

  • 什么时候ssh_keygen与ssh-keygen?我只在我的Ubuntu 16安装上安装了后者(带连字符).``ssh-keygen -t rsa -p""```因为没有id_rsa文件而失败,因为我没有在提示时指定替代方法. (2认同)

Mil*_*dal 5

尝试将文件夹的所有权:/var/log/hadoop/root更改为用户:munichong。在所有系统上,LOGS 目录需要由 hadoop 编辑。所以它需要编辑LOG文件夹及其内容的权限。

sudo 在这种情况下将不起作用,因为即使在此脚本完成其工作后,也需要具有更改文件夹内容的权限,即在后台启动 HADOOP 服务。


Mut*_*nan 5

您正在尝试 ssh 到您自己的计算机 (localhost),但缺少authorized_keys允许登录的文件。

SSH 中的此文件指定可用于登录配置该文件的用户帐户的 SSH 密钥。

请按照以下两个步骤进行正确配置。

在终端中使用以下命令生成新的密钥生成器:

ssh-keygen
Run Code Online (Sandbox Code Playgroud)

按 Enter 键保留默认名称 id_rsa.pub

现在注册生成的密钥文件:

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
Run Code Online (Sandbox Code Playgroud)