vunet@demo:~$ curl -XPUT -H "Content-Type:application/json" localhost:9200/vunet-1-1-test-index-2021.06.15/_settings -d '{ "index": { "number_of_replicas" : 0 } }'
However if you want this to be permanent, please update the index template corresponding to the index. For example if the index template name is “vunet”
Copy the current template to a tmp file.
curl -s localhost:9200/_template/vunet?pretty > /tmp/123
Open the tmp file, remove the second line and the corresponding end braces “}” at the end of the file.
Within the index settings block set number_of_replicas to zero.
"settings" : {
"index" : {
"number_of_replicas" : "0",
"refresh_interval" : "30s"
}
},
The upload the template using
curl -XPUT -H "Content-Type:application/json" localhost:9200/_template/vunet -d@/tmp/123
Note: Please double check your uploaded template by doing an XGET as before.