I have a standalone instance with Opensearch for testing purposes, I want to keep it light and clean so I'm using ISM to delete indices older than x days.
What I noticed is that by default Opensearch generates a management index (".opensearch-ism-config") with replica "1".
Since I'm using a standalone instance (it is just testing, I'm not worried with redundancy, HA or anything like that) and want to keep my cluster with green status, I have decided that I want those indices to have replica "0".
In order to achieve that, I have created a template in which I set replica "0" for these indices:
{
"order" : 100,
"version" : 1,
"index_patterns" : [".opensearch-ism-*"],
"settings" : {
"index": {
"number_of_shards" : "1",
"number_of_replicas": 0
}
}
}
After a PUT, I start using ISM so that the management ISM index is created after this template is on Opensearch node.
What I observe is that all management indices from ISM are generated with replica "1", therefore ignoring the template.
I can set replica to "0" by updating index settings after creation but this is not the ideal scenario as ISM index rotate and new ones are generated from time to time.
Is there any way to have ISM indices applying replica "0" automatically ?
I ran into this same issue when transitioning from Elasticsearch 6 to OpenSearch. In Elasticsearch I was accustomed to index templates being additive. For example, in Elasticsearch 6, I could do something like this:
Create an index template to configure ILM rollover alias
Create an index template to configure index shard settings
Create the initial index
Verify the settings
When I tried to do this same technique in Opensearch 2.3, I noticed that it did not work as I expected. The template with the higher priority overwrote the settings in the lower priority template, completely, even if there were not overlapping settings. In the example below, where I am doing the same thing as Elasticsearch (but using different verbs for OpenSearch), you will see that the additive behavior is no longer supported:
Create an index template to configure ISM rollover alias
Create an index template to configure index shard settings
Create the initial index
Verify the settings
As you can see, the
"number_of_shards": 2
setting gets overwritten.To apply both the shard settings and the ISM rollover settings, (and whatever other settings / mappings required), there are two options.
The OP answered in a later comment "It does, I have another index template". To solve for this scenario, option 2 is the way I suggest to follow.
Here is an example:
Create a component template to configure index shard settings
Create the index template to configure ILM rollover alias, referencing the component template
Create the initial index
Verify the settings