When creating an index for an Elasticsearch cluster, you can specify the number of shards, that is, the number of primary shards. Once an index is created, the number of primary shards cannot be changed, but the number of replicas can be changed. Number of replica shards = Number of primary shards x Number of replicas.
The left part of the console is the command input box, and the triangle icon in its upper-right corner is the execution button. The right part shows the execution result.
GET _cat/indices?v

PUT /indexname/_settings
{
"number_of_replicas" :1 //Number of replicas
}
indexname indicates the name of the index to be modified, and number_of_replicas indicates the number of replicas to be set.