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. Number of replica shards = Number of primary shards x Number of replicas.
You can change the number of index replicas of an Elasticsearch cluster in Kibana.
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.