Ubuntu: Permission denied on start-dfs.sh



Question:

I am trying to create a 2-node Hadoop cluster, following this guide. The one node is my Ubuntu laptop and the slave node, the 2nd one, is a virtualbox that also runs Ubuntu.

I am doing in the master node:

gsamaras@gsamaras:/home/hadoopuser/hadoop/sbin$ sudo ./start-dfs.sh  16/01/23 04:46:16 WARN hdfs.DFSUtil: Namenode for null remains unresolved for ID null.  Check your hdfs-site.xml file to ensure namenodes are configured properly.  Starting namenodes on [master]  master: ssh: Could not resolve hostname master: Name or service not known  root@localhost's password:   root@localhost's password: localhost: Permission denied, please try again.  

If now I edit my /etc/hosts/ file to this:

127.0.0.1   localhost  127.0.1.1   gsamaras  127.0.1.1   slave-1  127.0.1.1   master   // should I have this?  

the warning will leave, but I will still get a "permission denied". This question is exactly the same with mine's, but the answer did not help much. Any ideas please?


Solution:1

Try to give permission to your script file:

$ sudo chmod +x start-dfs.sh  

Then execute.

$ sudo bash start-dfs.sh  


Solution:2

I am able to resolve the issue using below commands.

The following commands are used for generating a key value pair using SSH. Copy the public keys form id_rsa.pub to authorized_keys, and provide the owner with read and write permissions to authorized_keys file respectively.

$ ssh-keygen -t rsa   $ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys   $ chmod 0600 ~/.ssh/authorized_keys   

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »