backup.asciidoc 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. [[backup]]
  2. === Back Up Your Data!
  3. Always back up your data before performing an upgrade. This will allow you to
  4. roll back in the event of a problem. The upgrades sometimes include upgrades
  5. to the Lucene libraries used by Elasticsearch to access the index files, and
  6. after an index file has been updated to work with a new version of Lucene, it
  7. may not be accessible to the versions of Lucene present in earlier
  8. Elasticsearch releases.
  9. [WARNING]
  10. .Always back up your data before upgrading
  11. =========================================
  12. You cannot roll back to an earlier version unless you have a backup of your data.
  13. =========================================
  14. ==== Backing up 1.0 and later
  15. To back up a running 1.0 or later system, it is simplest to use the snapshot
  16. feature. See the complete instructions for
  17. <<modules-snapshots,backup and restore with snapshots>>.
  18. ==== Backing up 0.90.x and earlier
  19. To back up a running 0.90.x system:
  20. ===== Step 1: Disable index flushing
  21. This will prevent indices from being flushed to disk while the backup is in
  22. process:
  23. [source,js]
  24. -----------------------------------
  25. PUT /_all/_settings
  26. {
  27. "index": {
  28. "translog.disable_flush": "true"
  29. }
  30. }
  31. -----------------------------------
  32. // AUTOSENSE
  33. ===== Step 2: Disable reallocation
  34. This will prevent the cluster from moving data files from one node to another
  35. while the backup is in process:
  36. [source,js]
  37. -----------------------------------
  38. PUT /_cluster/settings
  39. {
  40. "transient": {
  41. "cluster.routing.allocation.disable_allocation": "true"
  42. }
  43. }
  44. -----------------------------------
  45. // AUTOSENSE
  46. ===== Step 3: Backup your data
  47. After reallocation and index flushing are disabled, initiate a backup of
  48. Elasticsearch's data path using your favorite backup method (tar, storage
  49. array snapshots, backup software).
  50. ===== Step 4: Reenable allocation and flushing
  51. When the backup is complete and data no longer needs to be read from the
  52. Elasticsearch data path, allocation and index flushing must be re-enabled:
  53. [source,js]
  54. -----------------------------------
  55. PUT /_all/_settings
  56. {
  57. "index": {
  58. "translog.disable_flush": "false"
  59. }
  60. }
  61. PUT /_cluster/settings
  62. {
  63. "transient": {
  64. "cluster.routing.allocation.disable_allocation": "false"
  65. }
  66. }
  67. -----------------------------------
  68. // AUTOSENSE