rolling_upgrade.asciidoc 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. [[rolling-upgrades]]
  2. == Rolling upgrades
  3. A rolling upgrade allows an Elasticsearch cluster to be upgraded one node at
  4. a time so upgrading does not interrupt service. Running multiple versions of
  5. Elasticsearch 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. Rolling upgrades can be performed between minor versions. Elasticsearch
  9. 6.x supports rolling upgrades from *Elasticsearch 5.6*.
  10. Upgrading from earlier 5.x versions requires a <<restart-upgrade,
  11. full cluster restart>>. You must <<reindex-upgrade,reindex to upgrade>> from
  12. versions prior to 5.x.
  13. WARNING: If the {es} {security-features} are enabled on your 5.x cluster, before
  14. you can do a rolling upgrade you must encrypt the internode-communication with
  15. SSL/TLS, which requires a full cluster restart. For more information about this
  16. requirement and the associated bootstrap check, see <<bootstrap-checks-tls>>.
  17. WARNING: The format used for the internal indices used by Kibana and {xpack}
  18. has changed in 6.x. When upgrading from 5.6 to 6.x, these internal indices have
  19. to be {stack-ref}/upgrading-elastic-stack.html#upgrade-internal-indices[upgraded]
  20. before the rolling upgrade procedure can start. Otherwise the upgraded node will
  21. refuse to join the cluster.
  22. To perform a rolling upgrade:
  23. . *Disable shard allocation*.
  24. +
  25. --
  26. include::disable-shard-alloc.asciidoc[]
  27. --
  28. . *Stop non-essential indexing and perform a synced flush.* (Optional)
  29. +
  30. --
  31. While you can continue indexing during the upgrade, shard recovery
  32. is much faster if you temporarily stop non-essential indexing and perform a
  33. <<indices-synced-flush, synced-flush>>.
  34. include::synced-flush.asciidoc[]
  35. --
  36. . *Stop any machine learning jobs that are running.*
  37. +
  38. --
  39. include::close-ml.asciidoc[]
  40. --
  41. . [[upgrade-node]] *Shut down a single node*.
  42. +
  43. --
  44. include::shut-down-node.asciidoc[]
  45. --
  46. . *Upgrade the node you shut down.*
  47. +
  48. --
  49. include::remove-xpack.asciidoc[]
  50. --
  51. +
  52. --
  53. include::upgrade-node.asciidoc[]
  54. include::set-paths-tip.asciidoc[]
  55. --
  56. . *Upgrade any plugins.*
  57. +
  58. Use the `elasticsearch-plugin` script to install the upgraded version of each
  59. installed Elasticsearch plugin. All plugins must be upgraded when you upgrade
  60. a node.
  61. . If you use {es} {security-features} to define realms, verify that your realm
  62. settings are up-to-date. The format of realm settings changed in version 7.0, in
  63. particular, the placement of the realm type changed. See
  64. <<realm-settings,Realm settings>>.
  65. . *Start the upgraded node.*
  66. +
  67. --
  68. Start the newly-upgraded node and confirm that it joins the cluster by checking
  69. the log file or by submitting a `_cat/nodes` request:
  70. [source,sh]
  71. --------------------------------------------------
  72. GET _cat/nodes
  73. --------------------------------------------------
  74. // CONSOLE
  75. --
  76. . *Reenable shard allocation.*
  77. +
  78. --
  79. Once the node has joined the cluster, remove the `cluster.routing.allocation.enable`
  80. setting to enable shard allocation and start using the node:
  81. [source,js]
  82. --------------------------------------------------
  83. PUT _cluster/settings
  84. {
  85. "persistent": {
  86. "cluster.routing.allocation.enable": null
  87. }
  88. }
  89. --------------------------------------------------
  90. // CONSOLE
  91. --
  92. . *Wait for the node to recover.*
  93. +
  94. --
  95. Before upgrading the next node, wait for the cluster to finish shard allocation.
  96. You can check progress by submitting a <<cat-health,`_cat/health`>> request:
  97. [source,sh]
  98. --------------------------------------------------
  99. GET _cat/health
  100. --------------------------------------------------
  101. // CONSOLE
  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,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,sh]
  122. --------------------------------------------------
  123. GET _cat/recovery
  124. --------------------------------------------------
  125. // CONSOLE
  126. If you stopped indexing, it is safe to resume indexing as soon as
  127. recovery completes.
  128. --
  129. . *Repeat*
  130. +
  131. --
  132. When the node has recovered and the cluster is stable, repeat these steps
  133. for each node that needs to be updated.
  134. --
  135. . *Restart machine learning jobs.*
  136. +
  137. --
  138. include::open-ml.asciidoc[]
  139. --
  140. [IMPORTANT]
  141. ====================================================
  142. During a rolling upgrade, the cluster continues to operate normally. However,
  143. any new functionality is disabled or operates in a backward compatible mode
  144. until all nodes in the cluster are upgraded. New functionality
  145. becomes operational once the upgrade is complete and all nodes are running the
  146. new version. Once that has happened, there's no way to return to operating
  147. in a backward compatible mode. Nodes running the previous major version will
  148. not be allowed to join the fully-updated cluster.
  149. In the unlikely case of a network malfunction during the upgrade process that
  150. isolates all remaining old nodes from the cluster, you must take the
  151. old nodes offline and upgrade them to enable them to join the cluster.
  152. ====================================================