ElasticSearch-Fehler beheben: [1]: initial heap size [...] not equal to maximum heap size [...];
English
Deutsch
Problem:
Ihr ElasticSearch-Server startet nicht mit einer Fehlermeldung wie
output.txt
ERROR: [1] bootstrap checks failed
[1]: initial heap size [536870912] not equal to maximum heap size [2147483648]; this can cause resize pauses and prevents memory locking from locking the entire heap
ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/docker-cluster.logLösung
Setzen Sie die anfängliche Heap-Größe gleich der maximalen Heap-Größe: Das -Xms-Argument und das -Xmx-Argument müssen gleich sein, zum Beispiel:
jvm_opts.txt
-Xms2048m -Xmx2048mTypischerweise (z.B. in einem Docker-basierten Setup) können Sie dies in ES_JAVA_OPTS setzen:
env_vars.txt
ES_JAVA_OPTS=-Xms2048m -Xmx2048mFür docker-compose-basierte Umgebungen ist dies eine Beispielkonfiguration, die funktioniert:
docker-compose.yml
environment:
- cluster.name=docker-cluster
- node.name=elasticsearch1
- cluster.initial_master_nodes=elasticsearch1
- bootstrap.memory_lock=true
- http.cors.allow-origin=http://localhost:1358,http://127.0.0.1:1358
- http.cors.enabled=true
- http.cors.allow-headers=X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization
- http.cors.allow-credentials=true
- "ES_JAVA_OPTS=-Xms2048m -Xmx2048m"Starten Sie danach Ihre ElasticSearch-Instanz neu.
Check out similar posts by category:
ElasticSearch
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow