在 Hadoop-3.2.0 中 运行 start-dfs.sh 时出错

ERROR when run start-dfs.sh in Hadoop-3.2.0

我在配置Hadoop3.2.1 进行YARN 学习时遇到了一些问题。而且我在运行sbin/start-all.sh的时候发现root用户和host1用户有两种不同的情况。能告诉我怎么解决吗,和SSH有没有关系?非常感谢你。

在根中:

root@host1-virtual-machine:/home/host1/usr/hadoop-3.2.1# sbin/start-all.sh
Starting namenodes on [localhost]
ERROR: Attempting to operate on hdfs namenode as root
ERROR: but there is no HDFS_NAMENODE_USER defined. Aborting operation.
Starting datanodes
ERROR: Attempting to operate on hdfs datanode as root
ERROR: but there is no HDFS_DATANODE_USER defined. Aborting operation.
Starting secondary namenodes [host1-virtual-machine]
ERROR: Attempting to operate on hdfs secondarynamenode as root
ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting operation.
2020-02-12 14:40:27,093 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting resourcemanager
ERROR: Attempting to operate on yarn resourcemanager as root
ERROR: but there is no YARN_RESOURCEMANAGER_USER defined. Aborting operation.
Starting nodemanagers
ERROR: Attempting to operate on yarn nodemanager as root
ERROR: but there is no YARN_NODEMANAGER_USER defined. Aborting operation.

host1 用户:

host1@host1-virtual-machine:~/usr/hadoop-3.2.1$ sbin/start-all.sh
WARNING: Attempting to start all Apache Hadoop daemons as host1 in 10 seconds.
WARNING: This is not a recommended production deployment configuration.
WARNING: Use CTRL-C to abort.
Starting namenodes on [localhost]
localhost: host1@localhost: Permission denied (publickey,password).
Starting datanodes
localhost: host1@localhost: Permission denied (publickey,password).
Starting secondary namenodes [host1-virtual-machine]
host1-virtual-machine: host1@host1-virtual-machine: Permission denied (publickey,password).
Starting resourcemanager
Starting nodemanagers
localhost: host1@localhost: Permission denied (publickey,password).

您需要在节点之间设置无密码连接。这 link 可能会有所帮助 http://mynotesonhadoop.blogspot.com/2017/07/configuring-passwordless-ssh-from.html?m=1