start-dfs.sh上的权限被拒绝

我正在尝试按照本指南创建一个双节点Hadoop集群。 一个节点是我的Ubuntu笔记本电脑,第二个节点是一个也运行Ubuntu的虚拟机。

我在节点做:

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. 

如果现在我编辑我的/etc/hosts/文件到这个:

 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? 

警告将离开,但我仍然会得到“许可被拒绝”。 这个问题和我的问题完全一样,但答案并没有多大帮助。 有什么想法吗?

尝试授予您的脚本文件权限:

 $ sudo chmod +x start-dfs.sh 

然后执行。

 $ sudo bash start-dfs.sh 

我可以使用以下命令解决问题。

以下命令用于使用SSH生成密钥值对。 将公钥表单id_rsa.pub复制到authorized_keys,并分别向ownerdkeys文件提供读写权限。

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