This section applies to MRS 3.x or later clusters.
CGroups is a Linux kernel feature. In YARN this feature allows containers to be limited in their resource usage (example, CPU usage). Without CGroups, it is hard to limit the container CPU usage. Without CGroups, it is hard to limit the container CPU usage.
Currently, CGroups is only used for limiting the CPU usage.
CGroups is a Linux kernel feature and is enabled by using LinuxContainerExecutor. For details about how to configure the LinuxContainerExecutor for security, see the official website. You can learn the file system permissions assigned for users and user groups from documentation published on the official website.
The table below describes the parameter for configuring cpuset mode, that is, only configured CPUs can be used by YARN.
Parameter |
Description |
Default Value |
---|---|---|
yarn.nodemanager.linux-container-executor.cgroups.cpu-set-usage |
Whether to enable the cpuset mode. If this parameter is set to true, the cpuset mode is enabled. |
false |
The table below describes the parameters for configuring the strictcpuset mode, that is, only configured CPUs can be used by containers.
Parameter |
Description |
Default Value |
---|---|---|
yarn.nodemanager.linux-container-executor.cgroups.cpu-set-usage |
Whether to enable the cpuset mode. If this parameter is set to true, the cpuset mode is enabled. |
false |
yarn.nodemanager.linux-container-executor.cgroups.cpuset.strict.enabled |
Whether containers use allocated CPUs. If this parameter is set to true, the container can use the allocated CPUs. |
false |
To switch from cpuset mode to quota mode, the following conditions must be met:
Based on the configuration files and parameter functions, locate the row where parameter yarn-site.xml resides. Enter the parameter name in the Name column and enter the parameter value in the Value column.
Click + to add a customized parameter.
After the configuration is saved, restart the Yarn service whose configuration has expired for the configuration to take effect.