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:   localhost   gsamaras   slave-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?

  • Do sudo bash start-dfs.sh. – Raphael Jan 23 '16 at 3:46
  • Same behavior @Raphael – gsamaras Jan 23 '16 at 15:34

Try to give permission to your script file:

$ sudo chmod +x start-dfs.sh

Then execute.

$ sudo bash start-dfs.sh
  • What about /etc/hosts/, how should I have it? I am getting a sudo: +x: command not found. I asked a question about it here: askubuntu.com/questions/724681/sudo-x-command-not-found – gsamaras Jan 23 '16 at 15:47
  • That worked sudo chmod +x start-dfs.sh, but I am getting the same result, permission denied. – gsamaras Jan 23 '16 at 16:04
  • 1
    Solution: Go to sshd_config, change PermitRootLogin without-password -> PermitRootLogin yes and do an ssh restart. – gsamaras Jan 23 '16 at 16:35

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 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.