1
0

rolling_upgrade.asciidoc 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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. To perform a rolling upgrade:
  14. . *Disable shard allocation*.
  15. +
  16. --
  17. include::disable-shard-alloc.asciidoc[]
  18. --
  19. . *Stop non-essential indexing and perform a synced flush.* (Optional)
  20. +
  21. --
  22. While you can continue indexing during the upgrade, shard recovery
  23. is much faster if you temporarily stop non-essential indexing and perform a
  24. <<indices-synced-flush, synced-flush>>.
  25. include::synced-flush.asciidoc[]
  26. --
  27. . *Stop any machine learning jobs that are running.* See
  28. {xpack-ref}/stopping-ml.html[Stopping Machine Learning].
  29. . [[upgrade-node]] *Shut down a single node*.
  30. +
  31. --
  32. include::shut-down-node.asciidoc[]
  33. --
  34. . *Upgrade the node you shut down.*
  35. +
  36. --
  37. include::upgrade-node.asciidoc[]
  38. include::set-paths-tip.asciidoc[]
  39. --
  40. . *Upgrade any plugins.*
  41. +
  42. Use the `elasticsearch-plugin` script to install the upgraded version of each
  43. installed Elasticsearch plugin. All plugins must be upgraded when you upgrade
  44. a node.
  45. +
  46. include::remove-xpack.asciidoc[]
  47. . *Start the upgraded node.*
  48. +
  49. --
  50. Start the newly-upgraded node and confirm that it joins the cluster by checking
  51. the log file or by submitting a `_cat/nodes` request:
  52. [source,sh]
  53. --------------------------------------------------
  54. GET _cat/nodes
  55. --------------------------------------------------
  56. // CONSOLE
  57. --
  58. . *Reenable shard allocation.*
  59. +
  60. --
  61. Once the node has joined the cluster, remove the `cluster.routing.allocation.enable`
  62. setting to enable shard allocation and start using the node:
  63. [source,js]
  64. --------------------------------------------------
  65. PUT _cluster/settings
  66. {
  67. "persistent": {
  68. "cluster.routing.allocation.enable": null
  69. }
  70. }
  71. --------------------------------------------------
  72. // CONSOLE
  73. --
  74. . *Wait for the node to recover.*
  75. +
  76. --
  77. Before upgrading the next node, wait for the cluster to finish shard allocation.
  78. You can check progress by submitting a <<cat-health,`_cat/health`>> request:
  79. [source,sh]
  80. --------------------------------------------------
  81. GET _cat/health
  82. --------------------------------------------------
  83. // CONSOLE
  84. Wait for the `status` column to switch from `yellow` to `green`. Once the
  85. node is `green`, all primary and replica shards have been allocated.
  86. [IMPORTANT]
  87. ====================================================
  88. During a rolling upgrade, primary shards assigned to a node running the new
  89. version cannot have their replicas assigned to a node with the old
  90. version. The new version might have a different data format that is
  91. not understood by the old version.
  92. If it is not possible to assign the replica shards to another node
  93. (there is only one upgraded node in the cluster), the replica
  94. shards remain unassigned and status stays `yellow`.
  95. In this case, you can proceed once there are no initializing or relocating shards
  96. (check the `init` and `relo` columns).
  97. As soon as another node is upgraded, the replicas can be assigned and the
  98. status will change to `green`.
  99. ====================================================
  100. Shards that were not <<indices-synced-flush,sync-flushed>> might take longer to
  101. recover. You can monitor the recovery status of individual shards by
  102. submitting a <<cat-recovery,`_cat/recovery`>> request:
  103. [source,sh]
  104. --------------------------------------------------
  105. GET _cat/recovery
  106. --------------------------------------------------
  107. // CONSOLE
  108. If you stopped indexing, it is safe to resume indexing as soon as
  109. recovery completes.
  110. --
  111. . *Repeat*
  112. +
  113. --
  114. When the node has recovered and the cluster is stable, repeat these steps
  115. for each node that needs to be updated.
  116. --
  117. . *Restart machine learning jobs.*
  118. [IMPORTANT]
  119. ====================================================
  120. During a rolling upgrade, the cluster continues to operate normally. However,
  121. any new functionality is disabled or operates in a backward compatible mode
  122. until all nodes in the cluster are upgraded. New functionality
  123. becomes operational once the upgrade is complete and all nodes are running the
  124. new version. Once that has happened, there's no way to return to operating
  125. in a backward compatible mode. Nodes running the previous major version will
  126. not be allowed to join the fully-updated cluster.
  127. In the unlikely case of a network malfunction during the upgrade process that
  128. isolates all remaining old nodes from the cluster, you must take the
  129. old nodes offline and upgrade them to enable them to join the cluster.
  130. ====================================================