Enable Cgroups
You can enable CPU Scheduling to enable cgroups. You must configure certain properties
in yarn-site.xml on the ResourceManager and NodeManager hosts to enable
cgroups.
- Navigate to the Hosts option in the left navigation pane.
- Select Hosts Configuration. The Hosts Configuration page is displayed.
- Search for Enable Cgroups.
- Check the Enable Cgroup-based Resource Management box.
cgroups is a Linux kernel feature. cgroups is supported on the following Linux operating systems:
-
CentOS
-
RHEL
-
SUSE
-
Ubuntu
Enable cgroups
The following commands must be run on every reboot of the
NodeManager hosts to set up the cgroup hierarchy. Note that operating systems use
different mount points for the cgroup interface. Replace
/sys/fs/cgroup with your operating system equivalent.
mkdir -p /sys/fs/cgroup/cpu/yarn chown -R yarn /sys/fs/cgroup/cpu/yarn mkdir -p /sys/fs/cgroup/memory/yarn chown -R yarn /sys/fs/cgroup/memory/yarn mkdir -p /sys/fs/cgroup/blkio/yarn chown -R yarn /sys/fs/cgroup/blkio/yarn mkdir -p /sys/fs/cgroup/net_cls/yarn chown -R yarn /sys/fs/cgroup/net_cls/yarn mkdir -p /sys/fs/cgroup/devices/yarn chown -R yarn /sys/fs/cgroup/devices/yarn
