Hadoop permission: start-dfs.sh rejected

I install Hadoop on my laptop. SSH works fine, but I can't start 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).

I used "sudo". But permission is still forbidden.

Can anybody help me?

Thanks in advance!

+11
source share
8 answers

I was stuck in the same issue for the last couple of hours, but finally decided. I had a hadoop installation extracted by the same user as I use to have hadoop run. Therefore, the user privilege does not arise.
My configuration is this: Linux Ubuntu machine on Google Cloud.

Hadoop/home/ Hadoop/var/lib/hadoop - 777, . ssh , start-dfs.sh, "Permission denied ( )" , : ssh-:

  1. SSH-

2.It , , /home/hadoop/.ssh/id_rsa

3.it , .

4. cat/home/hadoop/.ssh/id_rsa.pub >>.ssh/authorized_keys ( auth /.ssh)

  1. ssh localhost

  2. start-dfs.sh ( !)

+21

, SSH " ", ssh- :

cd ~/.ssh

ssh_keygen -t rsa -p""

cat id_rsa.pub >> authorized_keys

... ...

+14

: /var/log/hadoop/root : munichong. , LOGS hadoop. LOG .

sudo , script, HADOOP .

+4

, , , , .

  • sudo -s -H

root

  1. ssh localhost

ssh ( node)

  1. ./sbin/start-dfs.sh

./sbin/start-yarn.sh

"cd" Hadoop, , HDFS MapRedude, .

:

root Hadoop, root, , , "Jake", ( LOGS)

enter image description here

+1

ssh (localhost) authorized_keys .

SSH SSH, , .

.

:

ssh-keygen

enter, id_rsa.pub

:

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
+1

, , root ssh-. https://askubuntu.com/questions/497895/permission-denied-for-rootlocalhost-for-ssh-connection .

SSH root. /etc/ssh/sshd _config

: PermitRootLogin PermitRootLogin yes

SSH: sudo service ssh restart

Or you can use SSH keys. If you don’t have it, create it using ssh-keygen (stick to the default value for the key and skip the password if you like it). Then do sudo -s (or whatever your preferred method for root is) and add the SSH key to /root/.ssh/authorized_keys:

cat / home / user / .ssh / id_rsa.pub β†’ /root/.ssh/authorized_keys

0
source

I solved this by setting permissions for all files 777:

sudo chmod 777 /usr/local/hadoop-2.7.6/* -R
0
source

R hadoop setting to resolve denied problem, below command works for start-all.sh

sudo chown -R hadoop /usr/local/hadoop/ 
0
source

All Articles