Rate This Document
Findability
Accuracy
Completeness
Readability

Preparations

Before using the Yarn package manager to start Hadoop, complete necessary Hadoop configurations. Then restart Hadoop.

  1. Modify the Hadoop configuration file on the server node.
    1. Modify hadoop/yarn-site.xml.
      1. Enable the container-executor configuration and set the user group to ${HADOOP_USER}. See the following figure:
        Figure 1 Enabling the container-executor configuration
      2. Enable the Node Labels feature.
        Figure 2 Enabling Node Labels
        Figure 3 yarn-site.xml
      3. Restart the ResourceManager for the configurations to take effect.
        • Query the node list to check whether the ResourceManager is running.
          yarn node -list
        • Stop the ResourceManager service.
          yarn --daemon stop resourcemanager
        • After the ResourceManager service is stopped, restart the service.
          yarn --daemon start resourcemanager
    2. Modify the hadoop/core-site.xml file. Set both the proxy user and user group to ${HADOOP_USER}.
      Figure 4 core-site.xml
    3. Create /etc/hadoop/container-executor.cfg. Add the following content to this file:
      yarn.nodemanager.linux-container-executor.group=hadoop_user#configured value of yarn.nodemanager.linux-container-executor.group
      banned.users=#comma separated list of users who can not run applications
      min.user.id=0#Prevent other super-users
      allowed.system.users=##comma separated list of system users who CAN run applications
      feature.tc.enabled=false
  2. Distribute yarn-site.xml, core-site.xml, and container-executor.cfg to all nodes. Then, run the following command on each node to modify the container-executor permission:
    chmod 6050 $HADOOP_HOME/bin/container-executor
  3. Restart Hadoop.
    Go to the Hadoop bin directory and restart Hadoop.
    cd $HADOOP_HOME/sbin
    ./stop-all.sh
    ./start-all.sh

    After Hadoop is restarted, run the jps command to check whether the ResourceManager is started. If it is not started, view the ResourceManager logs for analysis. If it is not started because the secure mode is enabled, exit the secure mode and restart the Hadoop service.

    hadoop dfsadmin -safemode leave
    ./start-all.sh