Can I setup an index as "read-only" in just a few nodes, and expect ES to route correctly?

(José de Zárate) #1

Say I have 5 nodes, and one one index with the standard 1 shard - 5
replicas configuration.

Can I configure the index, on a per node basis, as "read-only" in , say, 4
of those nodes, and expect that when an indexing request is made, ES will
route that to the one node that has write access to the index?


(Artem Grinblat) #2

IMHO, there can be no such thing as a read-only replica, the replicas would
need to index the update in order to stay up to date with the primary shard.
See also there
"There is no meaning to have balanced primary allocation since primary and
replica shards do the same work."

As the question is interesting to me as well, I did some search. It looks

You can route the requests to the primary shard with the "_primary"

You can move shards with

Choosing a primary shard is being worked on:


(system) #3