Configure Linux systems not running systemd
Before you can configure workload management on Linux systems not running systemd
, you must create a cgroup hierarchy in which splunkd
and other system processes run in their own cgroups.
The following diagram illustrates the cgroup hierarchy on Linux systems not running systemd
:
For more information, see cgroups.
Workload management support for Linux cgroups v2 is now available for Early Access customers in Splunk Enterprise version 9.3.0. In the Early Access release stage, Splunk products may have limitations on customer access, features, maturity and regional availability. For information on Early Access please contact your Splunk representative.
Configure cgroups on non-systemd distributions
There are two ways to configure cgroups for workload management on Linux systems not running systemd
:
You must configure cpu and memory cgroups for workload management on all search heads and indexers.
Configure cgroups using cgconfig
You can use the cgconfig
service installed with libcgroup
to create cgroups on Linux systems not running systemd
.
libcgroup
is deprecated in RHEL 7.0 and other Linux distributions that support systemd
.
To configure cgroups for workload management using cgconfig
:
- Check that
/sys/fs
is mounted. If it is not mounted, mount thetmpfs
in-memory filesystem under/sys/fs/cgroup
as follows:sudo mount -t tmpfs -o size=10M tmpfs /sys/fs
Splunk Enterprise examines the
/proc/mounts
file to determine whether your Linux machine can support workload management. - Create the
cgconfig.conf
file under/etc
and add the following contents:# Copyright IBM Corporation. 2007 # # Authors: Balbir Singh <balbir@linux.vnet.ibm.com> # This program is free software; you can redistribute it and/or modify it # under the terms of version 2.1 of the GNU Lesser General Public License # as published by the Free Software Foundation. # # This program is distributed in the hope that it would be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # See man cgconfig.conf for further details. # # By default, mount all controllers to /cgroup/<controller> mount { cpuset = /sys/fs/cgroup/cpuset; cpu = /sys/fs/cgroup/cpu; cpuacct = /sys/fs/cgroup/cpuacct; memory = /sys/fs/cgroup/memory; devices = /sys/fs/cgroup/devices; freezer = /sys/fs/cgroup/freezer; net_cls = /sys/fs/cgroup/net_cls; blkio = /sys/fs/cgroup/blkio; } group splunk { perm { admin { uid = "splunk"; gid = "splunk"; } task { uid = "splunk"; gid = "splunk"; } } cpu { cpu.shares = "2048"; } memory { memory.limit_in_bytes = "3G"; } }
- Restart the
cgconfig
service.# service cgconfig restart Stopping cgconfig service: [ OK ] Starting cgconfig service: [ OK ]
This creates the
splunk
cgroup.The cgroup name must match the value of
workload_pool_base_dir_name
defined inworkload_pools.conf
The default value issplunk
.
Configure cgroups using filesystem operations
To configure cgroups, the Linux admin, logged in as root
user, must create the cgroups and assign the splunk user permissions to manage the cgroups, as follows:
- In the
workload_pools.conf.
file, setworkload_pool_base_dir_name
to the root cgroup to be used by splunk. For example:[general] workload_pool_base_dir_name = splunk
Or, send a POST request:
workloads/config/set-base-dirname -workload_pool_base_dir_name <base_dir_name>
For endpoint details, see workloads/config/set-base-dirname in the Splunk Enterprise REST API Reference Manual.
- Create cpu and memory cgroups:
sudo mkdir /sys/fs/cgroup/cpu/<workload_pool_base_dir_name> sudo mkdir /sys/fs/cgroup/memory/<workload_pool_base_dir_name>
- Assign the splunk user permissions to manage the respective cgroups:
sudo chown -R ${USER} /sys/fs/cgroup/cpu/<workload_pool_base_dir_name> sudo chown -R ${USER} /sys/fs/cgroup/memory/<workload_pool_base_dir_name>
If you have specified a user as
SPLUNK_OS_USER
insplunk-launch.conf
, you must specify the same user as {USER} in the command. For more information see splunk-launch.conf in the Splunk Enterprise ''Admin Manual''. - Assign CPU shares for
splunk
cgroup:cd /sys/fs/cgroup/cpu/splunk echo 2048 > cpu.shares
- Assign physical memory for the
splunk
cgroup:cd /sys/fs/cgroup/memory/splunk/ echo 14G > memory.limit_in_bytes
Next step
After you set up cgroups on your Linux operating system, you can configure workload management in Splunk Enterprise. See Configure workload management.
Configure Linux systems running systemd | Configure cgroups v2 in Splunk Enterprise |
This documentation applies to the following versions of Splunk® Enterprise: 9.3.0, 9.3.1, 9.3.2
Feedback submitted, thanks!