<p>I am new to elastic search. I have a 3 data node and 3 master node elastic cluster deployed in Kubernetes. It was working well until recently there is a large intake of data. Now, I am in a stage where I need to apply index refresh interval configuration to 120s to allow optimal usage of the cluster. I am able to do it on individual index level <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html#reset-index-setting" rel="nofollow noreferrer">using this method</a>. but I am not able to do at the cluster level. I have a process that creates a new index everyday and do not have more than 15 indexes totally at any point of time in the cluster. So, currently, I am doing it manually by using the method afore mentioned/using Kibana UI. I tried to do this couple of ways both failed.</p>
<ol>
<li>Used the settings PUT method to force the index settings at the global level and it gives an error of no requests in the range</li>
</ol>
<p><code>PUT /_cluster/settings -d {      &quot;index&quot; : {        &quot;refresh_interval&quot; : &quot;120s&quot;      }    }</code></p>
<ol start="2">
<li>I used the elasticsearch yaml to set this value for the data node and the data node fails to come up.</li>
</ol>
<p>elasticsearch yaml</p>
<pre><code>apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: elastic-cluster
  namespace: elastic-system
spec:
  version: 7.6.2
  nodeSets:
    - name: master
      count: 3
      config:
        node.master: true
        node.data: false
        node.ingest: false
        node.ml: false
        node.store.allow_mmap: false
      podTemplate:
            ...
    - name: data1
      count: 3
      config:
        node.master: false
        node.data: true
        node.ingest: true
        node.ml: false
        node.store.allow_mmap: false
        index.refresh_interval: 120s # I added it here
      podTemplate:
            ...
</code></pre>
<p>There is a third way, through kibana UI -&gt; settings-&gt; Elastic Search -&gt; Index management -&gt; index template. But there is no index template for me to start with. Nevertheless, the elastic search creates an index daily with the date. So, I do not want to mess with the existing template.</p>
<p>Can anyone suggest me a better way to do this</p>

baatasaari
<p>The recommended way is to create an index template that applies default settings when an index is created.
<a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html</a></p>
<p>Old indexes are not affected by this template - only new ones.</p>
<p>If you don't want to create a template, you have to set the refresh interval manually.</p>
<p>You can try setting index settings with a wildcard like this:
<code>PUT /my-index-2022-*/_settings</code></p>
<p><code>/_cluster/settings</code> has no relation to index settings - it's configuration settings for the cluster, so don't try to do index operations with that URL.</p>
<p>The same applies to the YAML file - the configuration there has no relationship with the index settings.</p>
