cluster_restart.asciidoc 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. [[restart-upgrade]]
  2. === Full cluster restart upgrade
  3. Elasticsearch requires a full cluster restart when upgrading across major
  4. versions. Rolling upgrades are not supported across major versions. Consult
  5. this <<setup-upgrade,table>> to verify that a full cluster restart is
  6. required.
  7. The process to perform an upgrade with a full cluster restart is as follows:
  8. ==== Step 1: Disable shard allocation
  9. When you shut down a node, the allocation process will immediately try to
  10. replicate the shards that were on that node to other nodes in the cluster,
  11. causing a lot of wasted I/O. This can be avoided by disabling allocation
  12. before shutting down a node:
  13. [source,js]
  14. --------------------------------------------------
  15. PUT /_cluster/settings
  16. {
  17. "persistent": {
  18. "cluster.routing.allocation.enable": "none"
  19. }
  20. }
  21. --------------------------------------------------
  22. // AUTOSENSE
  23. ==== Step 2: Perform a synced flush
  24. Shard recovery will be much faster if you stop indexing and issue a
  25. <<indices-synced-flush, synced-flush>> request:
  26. [source,sh]
  27. --------------------------------------------------
  28. POST /_flush/synced
  29. --------------------------------------------------
  30. // AUTOSENSE
  31. A synced flush request is a ``best effort'' operation. It will fail if there
  32. are any pending indexing operations, but it is safe to reissue the request
  33. multiple times if necessary.
  34. ==== Step 3: Shutdown and upgrade all nodes
  35. Stop all Elasticsearch services on all nodes in the cluster. Each node can be
  36. upgraded following the same procedure described in <<upgrade-node>>.
  37. ==== Step 4: Upgrade any plugins
  38. Elasticsearch plugins must be upgraded when upgrading a node. Use the
  39. `elasticsearch-plugin` script to install the correct version of any plugins
  40. that you need.
  41. ==== Step 5: Start the cluster
  42. If you have dedicated master nodes -- nodes with `node.master` set to
  43. `true`(the default) and `node.data` set to `false` -- then it is a good idea
  44. to start them first. Wait for them to form a cluster and to elect a master
  45. before proceeding with the data nodes. You can check progress by looking at the
  46. logs.
  47. As soon as the <<master-election,minimum number of master-eligible nodes>>
  48. have discovered each other, they will form a cluster and elect a master. From
  49. that point on, the <<cat-health,`_cat/health`>> and <<cat-nodes,`_cat/nodes`>>
  50. APIs can be used to monitor nodes joining the cluster:
  51. [source,sh]
  52. --------------------------------------------------
  53. GET _cat/health
  54. GET _cat/nodes
  55. --------------------------------------------------
  56. // AUTOSENSE
  57. Use these APIs to check that all nodes have successfully joined the cluster.
  58. ==== Step 6: Wait for yellow
  59. As soon as each node has joined the cluster, it will start to recover any
  60. primary shards that are stored locally. Initially, the
  61. <<cat-health,`_cat/health`>> request will report a `status` of `red`, meaning
  62. that not all primary shards have been allocated.
  63. Once each node has recovered its local shards, the `status` will become
  64. `yellow`, meaning all primary shards have been recovered, but not all replica
  65. shards are allocated. This is to be expected because allocation is still
  66. disabled.
  67. ==== Step 7: Reenable allocation
  68. Delaying the allocation of replicas until all nodes have joined the cluster
  69. allows the master to allocate replicas to nodes which already have local shard
  70. copies. At this point, with all the nodes in the cluster, it is safe to
  71. reenable shard allocation:
  72. [source,js]
  73. ------------------------------------------------------
  74. PUT /_cluster/settings
  75. {
  76. "persistent": {
  77. "cluster.routing.allocation.enable": "all"
  78. }
  79. }
  80. ------------------------------------------------------
  81. // AUTOSENSE
  82. The cluster will now start allocating replica shards to all data nodes. At this
  83. point it is safe to resume indexing and searching, but your cluster will
  84. recover more quickly if you can delay indexing and searching until all shards
  85. have recovered.
  86. You can monitor progress with the <<cat-health,`_cat/health`>> and
  87. <<cat-recovery,`_cat/recovery`>> APIs:
  88. [source,sh]
  89. --------------------------------------------------
  90. GET _cat/health
  91. GET _cat/recovery
  92. --------------------------------------------------
  93. // AUTOSENSE
  94. Once the `status` column in the `_cat/health` output has reached `green`, all
  95. primary and replica shards have been successfully allocated.