Skip to main content
This guide walks you through setting up a Meilisearch cluster with three instances, three shards, and replication for redundancy.
Sharding requires the Meilisearch Enterprise Edition v1.37 or later.

Step 1: Start your instances

Start three Meilisearch instances, each with a master key:
If your instances communicate over a private network, add the --experimental-allowed-ip-networks flag:

Step 2: Enable the network feature

Enable the experimental network feature on each instance:
Repeat for ms-01 and ms-02 with their respective URLs and master keys.

Step 3: Configure the network topology

Send a single PATCH /network request to the leader instance (ms-00). The leader propagates the configuration to all other remotes automatically. For initial setup, define self, leader, remotes, and shards together:
In this configuration, each shard lives on exactly one remote. Documents are distributed across all three instances, and each instance handles searches for its own shards.
This setup has no replication. If a remote becomes unavailable, its shards are missing from search results. Meilisearch does not yet automatically fall back to another instance. See Configure replication for a high-availability setup.

Step 4: Index documents

Send documents to the leader instance (ms-00). The leader distributes them across shards automatically:
All write operations (document additions, updates, deletions, settings changes) must go through the leader instance. Non-leader instances reject writes with a not_leader error.

Step 5: Search across the cluster

Search requests can be sent to any instance in the network, not just the leader. useNetwork defaults to true when a network topology is defined:
Meilisearch fans out the search to all shards, collects results from each shard, and returns a single merged response.

Verify the topology

Check the current network configuration at any time:

Next steps

Manage the network

Add and remove remotes dynamically without reconfiguring the entire topology.

Replication and sharding overview

Understand the concepts behind sharding, replication, and network search.

Data backup

Configure snapshots and dumps for your cluster.