I am trying to change the number of shards and replicas for an index as shown below.. I am using ElasticSearch 2.4.0.
I did reindex the data and trying to change the number of shards and replicas with the new index.
For example if I want to reindex the bank data (screenshow below) - with 3 shards and 1 replica - how would I proceed?
Query:
curl -XPUT http://localhost:9200/newbank -d'{ "settings": {
"number_of_shards":2,
"number_of_replicas":1
}}'
Error:
{"error":{"root_cause":[{"type":"index_already_exists_exception","reason":"already exists","index":"newbank"}],"type":"index_already_exists_exception","reason":"already exists","index":"newbank"},"status":400}
Saw a similar kindof exception msg in elastic forum as well - which i have come across as well : https://discuss.elastic.co/t/elasticsearch-2-1-1-no-of-shard-settings/37825
Getting this error:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "can't change the number of shards for an index"
}
],
"type": "illegal_argument_exception",
"reason": "can't change the number of shards for an index"
},
"status": 400
Kindly help!
Thank you so much in advance.