rolling_upgrade.asciidoc 8.6 KB

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