I am trying to add a node in my cluster running on 7.17x with 3 existing nodes ( master eligible ), the new 4th node is data only node.
I am seeing new index have all primary shards allocated to 1 node, shouldn't they be allocated to all nodes with their replica allocated to some other node ?
I have index set to "cluster.routing.rebalance.enable": "all"
No, that is not a correct assumption... as long as the primary and replica are on different nodes, that is sufficient. Nothing says the primaries need to be spread out. That said, over time, that can / will happen, but when you add a new node, that is not necessarily the case... over time, shards will balance.
Think about a 2 node cluster with 1 primary and 1 replica... all the primaries could be on 1 node and all the replicas could be on another, that is perfectly fine.
There is a setting to accomplish what you want but you need to be careful..with it.
If you apply it wrongly or you do not have enough nodes, then the index will fail to allocate. Unless you are experienced with Elasticsearch I would be careful with this.
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.