quick recovery after node restart in elasticsearch

前端 未结 1 1940
暖寄归人
暖寄归人 2020-12-25 09:07

Consider the below settings in the elasticsearch.yml

gateway.recover_after_data_nodes: 3
gateway.recover_after_time: 5m
gateway.expected_data_nodes: 3


        
相关标签:
1条回答
  • 2020-12-25 09:20

    For Elasticsearch version >= 1.0.0:

    curl -XPUT localhost:9200/_cluster/settings -d '{"transient":{"cluster.routing.allocation.enable": "none"}}'
    /etc/init.d/elasticsearch restart
    curl -XPUT localhost:9200/_cluster/settings -d '{"transient":{"cluster.routing.allocation.enable": "all"}}'
    

    For earlier version of ES:

    curl -XPUT localhost:9200/_cluster/settings -d '{"transient":{"cluster.routing.allocation.disable_allocation": true}}'
    /etc/init.d/elasticsearch restart
    curl -XPUT localhost:9200/_cluster/settings -d '{"transient":{"cluster.routing.allocation.disable_allocation": false}}'
    

    Shard keep unallocated until "cluster.routing.allocation.disable_allocation": false, then shards recover on the server just restarted (starting at size they were before shutdown) It is very quick.

    Reference: http://elasticsearch-users.115913.n3.nabble.com/quick-recovery-after-node-restart-in-elasticsearch-td4033876.html#a4034211

    0 讨论(0)
提交回复
热议问题