Elasticsearch Cheat Sheet

  • Shard Allocation Issues
    • http 'localhost:9200/_cluster/allocation/explain?pretty' will explain things with an easy-to-understand vocabulary
  • Rolling Minor Version Upgrade
    1. echo '{"persistent":{"cluster.routing.allocation.enable": "primaries"}}' | http PUT localhost:9200/_cluster/settings
    2. http POST localhost:9200/_flush/synced - First time only
    3. Upgrade a node
    4. echo '{"persistent":{"cluster.routing.allocation.enable": null}}' | http PUT localhost:9200/_cluster/settings
    5. Wait for the node to recover
    6. Repeat until all nodes are upgraded

Thanks for reading! If you have any questions or comments, please send me a note on Twitter. And if you enjoyed this, I also have a newsletter where I sometimes write about tech thoughts, interesting things I've read, and project updates.

You can check out a recent issue, or enter your email below to subscribe.