These are the snippets I use most of the time when administrating my ES cluster
To be updated
curl -XPUT 'http://escluster:9200/_cluster/settings' -d '{
"transient" : {
"cluster.routing.allocation.enable": "none"
}
}'
curl -XPUT 'http://escluster:9200/_cluster/settings' -d '{
"transient" : {
"cluster.routing.allocation.enable": "all"
}
}'
curl -XPUT 'http://escluster:9200/_cluster/settings' -d '{
"transient" : {
"cluster.routing.allocation.cluster_concurrent_rebalance": 20,
"indices.recovery.concurrent_streams": 20,
"cluster.routing.allocation.node_initial_primaries_recoveries": 20,
"cluster.routing.allocation.node_concurrent_recoveries": 20,
"indices.recovery.max_bytes_per_sec": "2048mb",
"cluster.routing.allocation.disk.threshold_enabled" : true,
"cluster.routing.allocation.disk.watermark.low" : "90%",
"cluster.routing.allocation.disk.watermark.high" : "98%"
}
}'
curl -XPUT 'escluster:9200/_settings' -d '
{
"index" : {
"number_of_replicas" : 0,
"refresh_interval" : "1m"
}
}'
curl -XPUT 'escluster:9200/_settings' -d '
{
"index" : {
"number_of_replicas" : 1,
"refresh_interval" : "1s"
}
}'
curl -XPOST 'http://escluster:9200/blackhole_2_201301/_optimize' -d '{
"max_num_segments" : 1
}'
curl -XPUT 'http://escluster:9200/_cluster/settings' -d '{
"transient" : {
"cluster.routing.allocation.awareness.attributes": "rack_id"
}
}'
curl -XGET https://escluster/_cat/nodes?v
curl -XGET https://escluster/_cat/indices?v
curl -XGET https://escluster/_cat/shards?v
curl -XGET https://escluster/_recovery?pretty=true&active_only=true
curl -XGET https://escluster/_segments?pretty
curl -XGET https://escluster/_cluster/stats?pretty
curl -XGET https://escluster/_nodes/stats?pretty
curl -XGET https://escluster/someindice/_stats?pretty
curl -XGET https://escluster/someindice/_mapping
curl -XGET https://escluster/_cluster/settings
curl -XGET https://escluster/_settings