Skip to content

Commit fe939d2

Browse files
authored
Merge pull request #834 from denismaggior8/830-fixes
Fix for #830 Elasticsearch memory issue on memory constrained environments
2 parents 92524f4 + c3f3bb5 commit fe939d2

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

kubernetes/samples/scripts/elasticsearch-and-kibana/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ It runs the Elastic Stack on the same host and port that the operator's Helm cha
1515
to, therefore, you only need to set `elkIntegrationEnabled` to `true` in your
1616
`values.yaml` file.
1717

18+
To control Elasticsearch memory parameters (Heap allocation and Enabling/Disabling swapping) please open the file `elasticsearch_and_kibana.yaml`, search for env variables of the elasticsearch container and change the values of the following.
19+
20+
* ES_JAVA_OPTS: value may contain for example -Xms512m -Xmx512m to lower the default memory usage (please be aware that this value is only applicable for demo purpose and it is not the one recommended by Elasticsearch itself)
21+
* bootstrap.memory_lock: value may contain true (enables the usage of mlockall to try to lock the process address space into RAM, preventing any Elasticsearch memory from being swapped out) or false (disables the usage of mlockall to try to lock the process address space into RAM, preventing any Elasticsearch memory from being swapped out).
22+
1823
To install Elasticsearch and Kibana, use:
1924
```
2025
$ kubectl apply -f kubernetes/samples/scripts/elasticsearch-and-kibana/elasticsearch_and_kibana.yaml

kubernetes/samples/scripts/elasticsearch-and-kibana/elasticsearch_and_kibana.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ spec:
4747
ports:
4848
- containerPort: 9200
4949
- containerPort: 9300
50+
env:
51+
- name: ES_JAVA_OPTS
52+
value: -Xms2014m -Xmx1024m
53+
- name: bootstrap.memory_lock
54+
value: "true"
5055

5156
---
5257
kind: "Service"

0 commit comments

Comments
 (0)