Preparations
Before using the Yarn package manager to start Hadoop, complete necessary Hadoop configurations. Then restart Hadoop.
- Modify the Hadoop configuration file on the server node.
- Modify hadoop/yarn-site.xml.
- Enable the container-executor configuration and set the user group to ${HADOOP_USER}. See the following figure:
Figure 1 Enabling the container-executor configuration
- Enable the Node Labels feature.
Figure 2 Enabling Node Labels
Figure 3 yarn-site.xml
- 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
- Query the node list to check whether the ResourceManager is running.
- Enable the container-executor configuration and set the user group to ${HADOOP_USER}. See the following figure:
- Modify the hadoop/core-site.xml file. Set both the proxy user and user group to ${HADOOP_USER}.
Figure 4 core-site.xml
- 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
- Modify hadoop/yarn-site.xml.
- 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
- 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
Parent topic: Starting in Yarn Mode