title: Some problems in installing Hadoop.ERROR: Attempting to operate on hdfs namenode as root ERROR:
body: <p>I am new in learning Hadoop. And I meet some problems in its configuration. Before it, I finished the configuration of JAVA, SSH, core-site.xml, hdfs-site.xml and hadoop-env.sh. Please tell me how can I solve it. Thank you very much.</p>
  
  <pre><code>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 13:19:37,322 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.
  </code></pre>
  
  <p>After I add 5 lines into hadoop-env.sh, it warns the following:</p>
  
  <pre><code>Starting namenodes on [localhost]
  localhost: root@localhost: Permission denied (publickey,password).
  Starting datanodes
  localhost: root@localhost: Permission denied (publickey,password).
  Starting secondary namenodes [host1-virtual-machine]
  host1-virtual-machine: root@host1-virtual-machine: Permission denied (publickey,password).
  2020-02-12 20:26:27,702 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
  Starting resourcemanager
  Starting nodemanagers
  localhost: root@localhost: Permission denied (publickey,password).
  </code></pre>