1. With Docker Compose #
A node and its console.
The stack #
Since version 2.12, a strong admin password is mandatory: without it, or if it is too weak, OpenSearch stops at startup. Put it in a .env file, out of Git.
OPENSEARCH_INITIAL_ADMIN_PASSWORD=Str0ng!Passw0rd-2026services:
opensearch:
image: opensearchproject/opensearch:3
environment:
discovery.type: single-node
OPENSEARCH_INITIAL_ADMIN_PASSWORD: ${OPENSEARCH_INITIAL_ADMIN_PASSWORD}
OPENSEARCH_JAVA_OPTS: -Xms1g -Xmx1g
path.repo: /usr/share/opensearch/data/snapshots
ports:
- "9200:9200"
volumes:
- os-data:/usr/share/opensearch/data
dashboards:
image: opensearchproject/opensearch-dashboards:3
environment:
OPENSEARCH_HOSTS: '["https://opensearch:9200"]'
ports:
- "5601:5601"
depends_on: [opensearch]
volumes:
os-data:sudo sysctl -w vm.max_map_count=262144
docker compose up -d
curl -sk -u 'admin:Str0ng!Passw0rd-2026' -H 'Content-Type: application/json' https://localhost:9200/_cat/health?vThe console is at http://localhost:5601 (user admin).
Host settings #
Does the container stop immediately? Checkvm.max_map_counton the Linux host: the expected value is 262144. Make it permanent in/etc/sysctl.conf.
2. With the archive #
Without a container.
Installing on a server #
tar -xf opensearch-3.9.0-linux-x64.tar.gz && cd opensearch-3.9.0
echo 'discovery.type: single-node' >> config/opensearch.yml
export OPENSEARCH_INITIAL_ADMIN_PASSWORD='Str0ng!Passw0rd-2026'
./opensearch-tar-install.shThe script installs demo certificates and starts the node over HTTPS, hence the -k option of curl. For real production, replace these certificates.
Multiple garbage collectors selectedmessage? We hit it on 3.9 with the archive: it came from anOPENSEARCH_JAVA_OPTSexported in the environment. Set memory inconfig/jvm.optionsinstead.
3. Sizing memory #
The most important setting.
The JVM heap #
Set -Xms and -Xmx to the same value, about half of the machine's memory, and no more than 32 GB. The rest serves the system cache, heavily used by Lucene.
-Xms4g
-Xmx4gMy progress
Sign in to track your progress and take notes. Sign in
Recommended Articles
OpenSearch Dashboards, alerting and observability
Explore data in OpenSearch Dashboards, create alert monitors and discover Trace Analytics, Event ...
OpenSearch: concepts, architecture and differences with Elasticsearch
Understanding OpenSearch: project origin, license, differences with Elasticsearch, indexes, shard...
Indexing and searching in OpenSearch: mapping, DSL, PPL and SQL
Declare an index template, index with bulk, search with the Query DSL, aggregate and query with P...
Feeding OpenSearch: ingest pipelines and Data Prepper
Transform data with ingest pipelines, collect with Data Prepper, receive OTLP and avoid the dynam...
OpenSearch in production: ISM, backups, security and best practices
Automate the lifecycle with ISM, back up with snapshots, manage roles and size an OpenSearch clus...
Installing OpenObserve and ingesting your first data
Install OpenObserve with Docker Compose or the binary, configure it with its ZO_* variables, send...
Monitoring et troubleshooting Elasticsearch : santé, shards non assignés, JVM, hot threads et slow logs
Diagnostiquer un cluster Elasticsearch : cluster health et CAT APIs, shards non assignés et alloc...
Kibana : rôle, installation et premiers pas
Ce qu'est Kibana dans la suite Elastic, comment l'installer avec Elasticsearch (start-local, Dock...
Performance et capacity planning Elasticsearch : shards, heap, indexation et benchmarks
Dimensionner et optimiser Elasticsearch : taille et nombre de shards, heap JVM, caches, réglages ...