I've performed a rolling restart on a 3 nodes cluster. I've a replicas of 1, 4 shards per index and during the rolling restart, rebalance actions occurring makes my cluster always available and that's a good point. However, when the latest node of the cluster have finished to reboot, I see that there is no primary shards on it, only slave. Do you think this is a desirable effect ? Is there any advantage (regarding the balancing of the load) to force the placement of primary shards more homogeneously ?
Primary and replica shards generally do the same amount of work, so it is not necessarily an issue. One of the things where the work of primary and replica shards differ is around e.g. scripted updates to documents, where the new document id created on the primary and then replicated. If you are using a lot of updates you may want to manually reassign shards, but otherwise I would recommend leaving it as is unless you notice this resulting in uneven load.
You can delay reallocation when you perform a restart, which will prevent shards moving. It will however not prevent replica shards getting promoted to primary shards.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.