I have a cluster, that I'm on the process of setup everything to go to production. I have six data nodes and 3 masters. I don't know why but for some reason that I cannot identify the shards are allocated not every shard in every available data node. Look at this example:
id shard sc dc sto n pr ur
F1uGxNwOQEyTps-rFVoxyQ 4 12 217034 24.6mb es05 p
QL8h_hvuRU21XPKjl9Qc3g 3 4 216525 23.9mb es06 p
F1uGxNwOQEyTps-rFVoxyQ 2 12 216258 26.8mb es05 p
QL8h_hvuRU21XPKjl9Qc3g 1 6 216319 24mb es06 p
QL8h_hvuRU21XPKjl9Qc3g 5 12 217263 23.9mb es06 p
F1uGxNwOQEyTps-rFVoxyQ 0 7 216258 23.8mb es05 p
I set up this attribute (cluster.routing.allocation.same_shard.host) trying to force elastic, when creating new index (and its shards) allocate every primary shard on a "dedicated" data node. But this is not happening and every replica on a different data node also. My index template is using 6 primaries and 1 replica.
PUT _cluster/settings
{
"persistent": {
"cluster.routing.allocation.same_shard.host": "true"
}
}
I was wondering that elastic would do this "balance" by default since we don't want to have same shard allocated on the same data node. Is there any specific configuration I have to do to elastic do this? Do I need to use shard allocation awareness?
Hi warkolm, thanks for your reply. This is exactly what I dont want. I dont want to have two (or more) primaries of the same index on the same host. And this is what is happening. Any ideas on why this is happening? Thanks
The cluster can promote replica shards to become primary shards if nodes are lost or unavailable so this is something you can not completely control. If a node becomes unavailable or is restarted shards on other nodes will be promoted to primary shards. When the node rejoins the cluster it will get replica shards assigned but will likely hold no 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.