hadoop问题--root账户启动报错

我们如果使用root配置的hadoop并启动会出现报错

错误:

        Starting namenodes on [master]

        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 [slave1]

        ERROR: Attempting to operate on hdfs secondarynamenode as root

        ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting operation.

解决方法:

         在/hadoop/sbin路径下: 
         将start-dfs.sh,stop-dfs.sh两个文件顶部添加以下参数
              HDFS_DATANODE_USER=root
              HADOOP_SECURE_DN_USER=hdfs
              HDFS_NAMENODE_USER=root
              HDFS_SECONDARYNAMENODE_USER=root
         start-yarn.sh,stop-yarn.sh顶部也需添加以下
            YARN_RESOURCEMANAGER_USER=root
            HADOOP_SECURE_DN_USER=yarn
            YARN_NODEMANAGER_USER=root

欢迎转载,转载请注明出处

你可能感兴趣的:(hadoop-hdfs)