cluster_restart.asciidoc 4.2 KB

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