I am setting the index's shard to something other than 1. (Say 5). I was expecting to have 5 primary shards and 5 replica shards. But what I got is 5 primary shards and 1 replica shard.
Is there anyway to set the shard count for the replica?
Replica shards are 1:1 with primary shards so if you have 5 primary shards and 1 replica shard configured each primary shard will have one replica. Use the cat shards API to list shards.
@Christian_Dahlqvist Unfortunately that is not the case. That is why I am asking the question. Please try it out yourself. I set shard count to 5 expecting primary 5 and replica 5. But I got 5 on primary and 1 on replica.
Please show this in the output from the cat shards api. The cat indices api will show the settings where 5 (number of primary shards) and 1 (number of replica shards per primary shard) represents 10 total shards.
The information in your print screen is correct, this is the index management screen, it teels you that your index has 6 primary and 1 replica, it is not showing the total shards.
Try to run:
GET _cat/shards/index_name
And you will see that you have in total 12 shards for your index.
That indicates that each index has 6 primary shards and that each primary shard in turn has 1 replica, resulting in 12 shards (6 primary and 6 replica) per index. You can see this if you look at the cat shards API.
I got it now. The screen shot I have under Primary listed how many shards you have and under replica, the # is not how many replica shards it has. It is telling me how many replica the index has. Confusing screen.
GET _cat/shards/index_name did show it has 6 shard for replica.
Wrong screen to find shard info for replica.
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.