Linux

Where Does OpenSearch Store Indices and Config?

OpenSearch stores indices under path.data: /var/lib/opensearch for packages, /usr/share/opensearch/data in Docker.

Last updated

OpenSearch separates config from data by install type. Package installs read /etc/opensearch/opensearch.yml and write indices under /var/lib/opensearch. Docker images keep both under /usr/share/opensearch, with data at /usr/share/opensearch/data and config in the config subfolder.

The path.data setting is the one that matters, and it is per node for life. Sharing it between nodes corrupts cluster state, and switching it to an empty folder silently starts over. Snapshots, not file copies across nodes, are the supported move.

Where OpenSearch stores this, by platform

Linux
/var/lib/opensearch

Package default from path.data. Config in /etc/opensearch/opensearch.yml. Snapshot before moves; never share one path between two nodes.

Linux
/usr/share/opensearch/data

Container data path. Mount a volume here plus a custom opensearch.yml into the config dir for TLS and cluster settings.

Frequently asked questions

How do I persist OpenSearch data in Docker?

Mount a volume to /usr/share/opensearch/data and keep a custom opensearch.yml mounted beside it. Without the volume, redeploys start an empty cluster.

How do I move data to a new node?

Take a snapshot to shared storage and restore it on the new node. Two nodes must never share one path.data directory, since node identity lives inside it.

How do I relocate the data directory?

Set path.data in opensearch.yml, move files with rsync while stopped, and fix ownership to the opensearch user. Pointing at a new empty folder mimics a fresh install.

Notice an outdated path? Let us know.