Last active
September 21, 2020 05:35
-
-
Save hivefans/5e672d76983646ee41f3 to your computer and use it in GitHub Desktop.
Increase Indexing Performance - Elasticsearch|-|{"files":{"ImproveIndexingPerformance.sh":{"env":"plain"}},"tag":"bigdata"}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #Close index | |
| curl -XPOST "localhost:9200/$1/_close" | |
| #refresh rate | |
| curl -XPUT "localhost:9200/$1/_settings" -d '{ | |
| "index" : { | |
| "refresh_interval" :-1 | |
| } | |
| }' | |
| #merge policy | |
| curl -XPUT "localhost:9200/$1/_settings" -d '{ | |
| "index" : { | |
| "index.merge.policy.merge_factor" : 30 | |
| } | |
| }' | |
| #replicas | |
| curl -XPUT "localhost:9200/$1/_settings" -d '{ | |
| "index" : { | |
| "number_of_replicas" : 0 | |
| } | |
| }' | |
| #flush | |
| curl -XPUT "localhost:9200/$1/_settings" -d '{ | |
| "index":{ | |
| "index.translog.flush_threshold_size":10000 | |
| } | |
| }' | |
| #buffer | |
| curl -XPUT "localhost:9200/$1/_settings" -d '{ | |
| "index":{ | |
| "indices.memory.index_buffer_size": 30 | |
| } | |
| }' | |
| curl -XPOST "localhost:9200/$1/_open" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to execute/run this? I'm using ES with Python Client.