Hi Team,
We are migrating our Elasticsearch 9.1.3 cluster from Windows Server to RHEL Linux (9.8). The environment consists of 2 dedicated master nodes, 4 data nodes, nodes, and 2 Logstash nodes.
As part of the Linux pre-requisites, we requested the OS team to configure the recommended Elasticsearch settings such as vm.max_map_count=262144, vm.swappiness=1, fs.file-max=65535, ulimit (nofile=65535, nproc=4096, memlock=unlimited), memory lock, and Transparent Huge Pages (THP). Most of these configurations have been completed successfully.
However, there are two points where the OS team has raised concerns:
-
Swap: Their standard practice is to keep swap enabled. Currently, an 8 GB swap partition is configured but not being used (
0B used). They are reluctant to disable swap unless there is a strong technical requirement.
$ swapon --show
NAME TYPE SIZE USED PRIO
/dev/dm-5 partition 8G 0B -2 -
SELinux: SELinux is configured in Enforcing mode. Changing it to Permissive or Disabled requires InfoSec approval. They mentioned they can keep SELinux in Enforcing mode if the required policies are configured.
$ getenforce
Enforcing
$ sestatus
SELinux status: enabled
Current mode: enforcing
Mode from config file: enforcing
Policy version: <policy_version>
Policy from config file: targeted
My questions are:
- Is it safe to proceed with a production Elasticsearch deployment if swap remains enabled but unused?
- If
bootstrap.memory_lock: trueis configured, is disabling swap still strongly recommended? - Has anyone successfully run Elasticsearch in production with swap enabled, and were there any performance or stability issues?
- Is Elasticsearch 9.x fully supported with SELinux in Enforcing mode when the appropriate SELinux policies are configured?
- Are there any additional recommendations or best practices for running Elasticsearch on RHEL with SELinux Enforcing?
I'd appreciate any guidance or production experience from the community. Thanks in advance!