Yarn启动Hadoop(3.2.2及以上版本)时返回如下信息。
2024-09-19 15:41:42,256 INFO org.apache.hadoop.service.AbstractService: Service NodeManager failed in state INITED org.apache.hadoop.yarn.exceptions.YarnRuntimeException: Failed to initialize container executor ... Caused by: ExitCodeException exitCode=24: File /home/sparkadmin/hadoop-3.2.0/etc/hadoop/container-executor.cfg must be owned by root, but is owned by 1002
由于LinuxContainerExecutor通过container-executor来启动容器,出于系统安全考虑,要求其所依赖的配置文件container-executor.cfg及其各级父路径所有者必须为root用户。该问题原因是container-executor中配置的路径为默认路径,需重新编译container-executor。
cmake src -DHADOOP_CONF_DIR=/etc/hadoop make