rolling_upgrade.asciidoc 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. [[rolling-upgrades]]
  2. == Rolling upgrades
  3. A rolling upgrade allows an {es} cluster to be upgraded one node at
  4. a time so upgrading does not interrupt service. Running multiple versions of
  5. {es} in the same cluster beyond the duration of an upgrade is
  6. not supported, as shards cannot be replicated from upgraded nodes to nodes
  7. running the older version.
  8. It is best to upgrade the master-eligible nodes in your cluster after all of
  9. the other nodes. Once you have started to upgrade the master-eligible nodes
  10. they may form a cluster that nodes of older versions cannot join. If you
  11. upgrade the master-eligible nodes last then all the other nodes will not be
  12. running an older version and so they will be able to join the cluster.
  13. Rolling upgrades are supported:
  14. * Between minor versions
  15. * {stack-ref-68}/upgrading-elastic-stack.html[From 5.6 to 6.8]
  16. * {stack-ref-70}/upgrading-elastic-stack.html[From 6.8 to 7.0]
  17. * From {prev-major-version} to {version}
  18. Upgrading directly to {version} from 6.6 or earlier requires a
  19. <<restart-upgrade, full cluster restart>>.
  20. include::preparing_to_upgrade.asciidoc[]
  21. [float]
  22. === Upgrading your cluster
  23. To perform a rolling upgrade to {version}:
  24. . *Disable shard allocation*.
  25. +
  26. --
  27. include::disable-shard-alloc.asciidoc[]
  28. --
  29. . *Stop non-essential indexing and perform a synced flush.* (Optional)
  30. +
  31. --
  32. While you can continue indexing during the upgrade, shard recovery
  33. is much faster if you temporarily stop non-essential indexing and perform a
  34. <<indices-synced-flush-api, synced-flush>>.
  35. include::synced-flush.asciidoc[]
  36. --
  37. . *Temporarily stop the tasks associated with active {ml} jobs and {dfeeds}.* (Optional)
  38. +
  39. --
  40. include::close-ml.asciidoc[]
  41. --
  42. . [[upgrade-node]] *Shut down a single node*.
  43. +
  44. --
  45. include::shut-down-node.asciidoc[]
  46. --
  47. . *Upgrade the node you shut down.*
  48. +
  49. --
  50. include::upgrade-node.asciidoc[]
  51. include::set-paths-tip.asciidoc[]
  52. [[rolling-upgrades-bootstrapping]]
  53. NOTE: You should leave `cluster.initial_master_nodes` unset while performing a
  54. rolling upgrade. Each upgraded node is joining an existing cluster so there is
  55. no need for <<modules-discovery-bootstrap-cluster,cluster bootstrapping>>. You
  56. must configure <<built-in-hosts-providers,either `discovery.seed_hosts` or
  57. `discovery.seed_providers`>> on every node.
  58. --
  59. . *Upgrade any plugins.*
  60. +
  61. Use the `elasticsearch-plugin` script to install the upgraded version of each
  62. installed {es} plugin. All plugins must be upgraded when you upgrade
  63. a node.
  64. . If you use {es} {security-features} to define realms, verify that your realm
  65. settings are up-to-date. The format of realm settings changed in version 7.0, in
  66. particular, the placement of the realm type changed. See
  67. <<realm-settings,Realm settings>>.
  68. . *Start the upgraded node.*
  69. +
  70. --
  71. Start the newly-upgraded node and confirm that it joins the cluster by checking
  72. the log file or by submitting a `_cat/nodes` request:
  73. [source,console]
  74. --------------------------------------------------
  75. GET _cat/nodes
  76. --------------------------------------------------
  77. --
  78. . *Reenable shard allocation.*
  79. +
  80. --
  81. Once the node has joined the cluster, remove the `cluster.routing.allocation.enable`
  82. setting to enable shard allocation and start using the node:
  83. [source,console]
  84. --------------------------------------------------
  85. PUT _cluster/settings
  86. {
  87. "persistent": {
  88. "cluster.routing.allocation.enable": null
  89. }
  90. }
  91. --------------------------------------------------
  92. --
  93. . *Wait for the node to recover.*
  94. +
  95. --
  96. Before upgrading the next node, wait for the cluster to finish shard allocation.
  97. You can check progress by submitting a <<cat-health,`_cat/health`>> request:
  98. [source,console]
  99. --------------------------------------------------
  100. GET _cat/health?v
  101. --------------------------------------------------
  102. Wait for the `status` column to switch from `yellow` to `green`. Once the
  103. node is `green`, all primary and replica shards have been allocated.
  104. [IMPORTANT]
  105. ====================================================
  106. During a rolling upgrade, primary shards assigned to a node running the new
  107. version cannot have their replicas assigned to a node with the old
  108. version. The new version might have a different data format that is
  109. not understood by the old version.
  110. If it is not possible to assign the replica shards to another node
  111. (there is only one upgraded node in the cluster), the replica
  112. shards remain unassigned and status stays `yellow`.
  113. In this case, you can proceed once there are no initializing or relocating shards
  114. (check the `init` and `relo` columns).
  115. As soon as another node is upgraded, the replicas can be assigned and the
  116. status will change to `green`.
  117. ====================================================
  118. Shards that were not <<indices-synced-flush-api,sync-flushed>> might take longer to
  119. recover. You can monitor the recovery status of individual shards by
  120. submitting a <<cat-recovery,`_cat/recovery`>> request:
  121. [source,console]
  122. --------------------------------------------------
  123. GET _cat/recovery
  124. --------------------------------------------------
  125. If you stopped indexing, it is safe to resume indexing as soon as
  126. recovery completes.
  127. --
  128. . *Repeat*
  129. +
  130. --
  131. When the node has recovered and the cluster is stable, repeat these steps
  132. for each node that needs to be updated. You can monitor the health of the cluster
  133. with a <<cat-health,`_cat/health`>> request:
  134. [source,console]
  135. --------------------------------------------------
  136. GET /_cat/health?v
  137. --------------------------------------------------
  138. And check which nodes have been upgraded with a <<cat-nodes,`_cat/nodes`>> request:
  139. [source,console]
  140. --------------------------------------------------
  141. GET /_cat/nodes?h=ip,name,version&v
  142. --------------------------------------------------
  143. --
  144. . *Restart machine learning jobs.*
  145. +
  146. --
  147. include::open-ml.asciidoc[]
  148. --
  149. [IMPORTANT]
  150. ====================================================
  151. During a rolling upgrade, the cluster continues to operate normally. However,
  152. any new functionality is disabled or operates in a backward compatible mode
  153. until all nodes in the cluster are upgraded. New functionality becomes
  154. operational once the upgrade is complete and all nodes are running the new
  155. version. Once that has happened, there's no way to return to operating in a
  156. backward compatible mode. Nodes running the previous major version will not be
  157. allowed to join the fully-updated cluster.
  158. In the unlikely case of a network malfunction during the upgrade process that
  159. isolates all remaining old nodes from the cluster, you must take the old nodes
  160. offline and upgrade them to enable them to join the cluster.
  161. If you stop half or more of the master-eligible nodes all at once during the
  162. upgrade then the cluster will become unavailable, meaning that the upgrade is
  163. no longer a _rolling_ upgrade. If this happens, you should upgrade and restart
  164. all of the stopped master-eligible nodes to allow the cluster to form again, as
  165. if performing a <<restart-upgrade,full-cluster restart upgrade>>. It may also
  166. be necessary to upgrade all of the remaining old nodes before they can join the
  167. cluster after it re-forms.
  168. Similarly, if you run a testing/development environment with only one master
  169. node, the master node should be upgraded last. Restarting a single master node
  170. forces the cluster to be reformed. The new cluster will initially only have the
  171. upgraded master node and will thus reject the older nodes when they re-join the
  172. cluster. Nodes that have already been upgraded will successfully re-join the
  173. upgraded master.
  174. ====================================================