Troubleshoot cgroups configuration
YARN NodeManager startup failures and broken resource isolation in cgroups v2 environments indicate altered default executor properties or leftover legacy cgroups v1 directories on disk.
Required default configurations
The following properties must remain at their default values for cgroups to function correctly. Changing these values causes the NodeManager to fail to start or isolate resources incorrectly.
- yarn.nodemanager.linux-container-executor.group
Must be set to hadoop.
This property defines the Unix group that owns thecontainer-executorbinary and configuration files. Changing this value breaks security rules and stops containers from starting.- yarn.nodemanager.linux-container-executor.cgroups.mount
Must be set to false.
NodeManager cannot automatically mount cgroups. Your operating system must mount the cgroup filesystem before NodeManager starts.
OS upgrade cleanup after migration to cgroups v2
If you performed an in-place major OS upgrade to a cgroups v2-only environment (for example, from RHEL 7 or RHEL 8 to RHEL 9), legacy cgroups v1 subhierarchies might remain on disk. YARN detects these legacy paths and incorrectly falls back to cgroups v1, breaking resource isolation on the upgraded OS.
Detecting legacy cgroups paths - On each NodeManager host, verify whether the following legacy cgroups v1 directories exist:
- /sys/fs/cgroup/cpu
- /sys/fs/cgroup/memory
- /sys/fs/cgroup/blkio
- /sys/fs/cgroup/net_cls
- /sys/fs/cgroup/devices
If any of these folders exist, clean them using the following steps before starting NodeManager.
Cleaning legacy paths
- Migrate all process IDs from the cgroup.procs file in each
legacy directory to the global cgroups v2 procs file. For example:
Repeat for each legacy path that contains a cgroup.procs file.cat /sys/fs/cgroup/cpu/cgroup.procs >> /sys/fs/cgroup/cgroup.procs - Delete all subdirectories, such as yarn or containers inside each old folder, starting from the deepest level up.
- Delete the top-level legacy cgroup directories listed above.
