How do I stop ES replication in my setup?

How do I stop ES replication in my setup?

Question:
ES is be default to replicate data being received for high availability. Though this makes sure that we have all the data available even if one of the analyser node goes down but it also slows down the overall indexing. In some places, we may want to stop this replication. To do this, what should we do?

Answer:
You can do this temporarily on a set of indices by directly setting “number_of_replicas” to zero using curl XPUT

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.

    • Related Articles

    • Duplicate documents are reflecting for snmp data in ES - 536

                   Solution Document  Duplicate documents in Elasticsearch   Overview General/Customer specific General Author Rukmini Reviewer Aman,Siva Approver   Release date 03/08/2022 Product Version 9.1r3 ...
    • Container based setup migration issue

      In the container-based setup with the new developer update, there is an error as below: (Access denied for user) Please suggest how to fix this issue. To fix this issue, kindly login into the database using the below command and create one more user. ...
    • ES Has Become Readonly

      Ques - ES has become readonly and unable to index any data. How to resolve this? Ans - https://kb.objectrocket.com/elasticsearch/how-to-fix-the-forbidden-12-read-only-api-error-in-elasticsearch-282   ...
    • unable to read data from ES having nested fields 505

       Solution Document ICICI || unable to read data from ES having nested fields   Overview General/Customer specific General Author Tejaswi Botla Reviewer NA Approver  NA  Release date 18/08/2022 Product Version 8.5r5 Audience: ...
    • Ticket ID 1194 : Getting request to ES failed on multiple dashboards

      Solution Document [1194] Getting request to ES failed on multiple dashboards Overview General/Customer specific General Author Yash Gawhad Reviewer NA Approver NA Release date 03/11/2023 Product Version 9.5r0 Audience: ...