ERROR: User defined in HDFS_DATANODE_SECURE_USER (yarn) does not exist. Aborting.

错误

在4台服务器上安装高可用的Hadoop时,启动DataNode一直报下列的错误:
在Google了半天,也没有找到原因真的是抓耳挠撒
下面是启动时的报错。

[root@node01 hadoop]# start-all.sh 
Starting namenodes on [node01 node02]
Starting datanodes
node02: ERROR: User defined in HDFS_DATANODE_SECURE_USER (yarn) does not exist. Aborting.
node03: ERROR: User defined in HDFS_DATANODE_SECURE_USER (yarn) does not exist. Aborting.
node04: ERROR: User defined in HDFS_DATANODE_SECURE_USER (yarn) does not exist. Aborting.
Starting journal nodes [node01 node02 node03]
2019-04-26 15:14:39,251 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting ZK Failover Controllers on NN hosts [node01 node02]
Starting resourcemanagers on [ node03 node04]
node04: WARNING: /opt/hadoop-3.1.2/logs does not exist. Creating.
Starting nodemanagers

解决方法:

  1. hadoop-env.sh里面的角色分配全部给注释掉
    #JAVA
    export JAVA_HOME=/usr/java/jdk1.8.0_201-amd64
    # HDFS
    # export HDFS_NAMENODE_USER=root
    # export HDFS_DATANODE_USER=root
    # export HDFS_SECONDARYNAMENODE_USER=root
    # export HDFS_ZKFC_USER=root
    # export HDFS_JOURNALNODE_USER=root
    # export HADOOP_SECURE_DN_USER=hdfs
    # export HDFS_DATANODE_SECURE_USER=hdfs
    
    #YARN
    #export YARN_RESOURCEMANAGER_USER=root
    # export HADOOP_SECURE_DN_USER=yarn 
    #export HDFS_DATANODE_SECURE_USER=yarn
    #export YARN_NODEMANAGER_USER=root
    
    
  2. start-dfs.sh, stop-dfs.sh中添加入如下的内容
    #!/usr/bin/env bash
    
    HDFS_DATANODE_USER=root
    HDFS_DATANODE_SECURE_USER=hdfs
    HDFS_NAMENODE_USER=root
    HDFS_SECONDARYNAMENODE_USER=root
    
    # Licensed to the Apache Software Foundation (ASF) under one or more
    # contributor license agreements.  See the NOTICE file distributed with
    # this work for additional information regarding copyright ownership.
    # The ASF licenses this file to You under the Apache License, Version 2.0
    ...........
    
  3. start-yarn.sh, stop-yarn.sh中添加如下内容
    #!/usr/bin/env bash
    
    YARN_RESOURCEMANAGER_USER=root
    HDFS_DATANODE_SECURE_USER=yarn
    YARN_NODEMANAGER_USER=root
    
    # Licensed to the Apache Software Foundation (ASF) under one or more
    # contributor license agreements.  See the NOTICE file distributed with
    # this work for additional information regarding copyright ownership.
    # The ASF licenses this file to You under the Apache License, Version 2.0
    ............
    

你可能感兴趣的:(Hadoop)