keystore.asciidoc 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. [[elasticsearch-keystore]]
  2. == elasticsearch-keystore
  3. The `elasticsearch-keystore` command manages <<secure-settings,secure settings>>
  4. in the {es} keystore.
  5. [discrete]
  6. [[elasticsearch-keystore-synopsis]]
  7. === Synopsis
  8. [source,shell]
  9. --------------------------------------------------
  10. bin/elasticsearch-keystore
  11. ([add <setting>] [--stdin] |
  12. [add-file <setting> <path>] | [create] |
  13. [list] | [remove <setting>] | [upgrade])
  14. [-h, --help] ([-s, --silent] | [-v, --verbose])
  15. --------------------------------------------------
  16. [discrete]
  17. [[elasticsearch-keystore-description]]
  18. === Description
  19. IMPORTANT: This command should be run as the user that will run {es}.
  20. Currently, all secure settings are node-specific settings that must have the
  21. same value on every node. Therefore you must run this command on every node.
  22. Modifications to the keystore do not take effect until you restart {es}.
  23. Only some settings are designed to be read from the keystore. However, there
  24. is no validation to block unsupported settings from the keystore and they can
  25. cause {es} to fail to start. To see whether a setting is supported in the
  26. keystore, see the setting reference.
  27. [discrete]
  28. [[elasticsearch-keystore-parameters]]
  29. === Parameters
  30. `add <setting>`:: Adds settings to the keystore. By default, you are prompted
  31. for the value of the setting.
  32. `add-file <setting> <path>`:: Adds a file to the keystore.
  33. `create`:: Creates the keystore.
  34. `-h, --help`:: Returns all of the command parameters.
  35. `list`:: Lists the settings in the keystore.
  36. `remove <setting>:: Removes a setting from the keystore.
  37. `-s, --silent`:: Shows minimal output.
  38. `--stdin`:: When used with the `add` parameter, you can pass the setting value
  39. through standard input (stdin). See <<add-string-to-keystore>>.
  40. `upgrade`:: Upgrades the internal format of the keystore.
  41. `-v, --verbose`:: Shows verbose output.
  42. [discrete]
  43. [[elasticsearch-keystore-examples]]
  44. === Examples
  45. [discrete]
  46. [[creating-keystore]]
  47. ==== Create the keystore
  48. To create the `elasticsearch.keystore`, use the `create` command:
  49. [source,sh]
  50. ----------------------------------------------------------------
  51. bin/elasticsearch-keystore create
  52. ----------------------------------------------------------------
  53. A `elasticsearch.keystore` file is created alongside the `elasticsearch.yml`
  54. file.
  55. [discrete]
  56. [[list-settings]]
  57. ==== List settings in the keystore
  58. To list the settings in the keystore, use the `list` command.
  59. [source,sh]
  60. ----------------------------------------------------------------
  61. bin/elasticsearch-keystore list
  62. ----------------------------------------------------------------
  63. [discrete]
  64. [[add-string-to-keystore]]
  65. ==== Add settings to the keystore
  66. Sensitive string settings, like authentication credentials for Cloud plugins,
  67. can be added with the `add` command:
  68. [source,sh]
  69. ----------------------------------------------------------------
  70. bin/elasticsearch-keystore add the.setting.name.to.set
  71. ----------------------------------------------------------------
  72. You are prompted to enter the value of the setting. To pass the value
  73. through standard input (stdin), use the `--stdin` flag:
  74. [source,sh]
  75. ----------------------------------------------------------------
  76. cat /file/containing/setting/value | bin/elasticsearch-keystore add --stdin the.setting.name.to.set
  77. ----------------------------------------------------------------
  78. [discrete]
  79. [[add-file-to-keystore]]
  80. ==== Add files to the keystore
  81. You can add sensitive files, like authentication key files for Cloud plugins,
  82. using the `add-file` command. Be sure to include your file path as an argument
  83. after the setting name.
  84. [source,sh]
  85. ----------------------------------------------------------------
  86. bin/elasticsearch-keystore add-file the.setting.name.to.set /path/example-file.json
  87. ----------------------------------------------------------------
  88. [discrete]
  89. [[remove-settings]]
  90. ==== Remove settings from the keystore
  91. To remove a setting from the keystore, use the `remove` command:
  92. [source,sh]
  93. ----------------------------------------------------------------
  94. bin/elasticsearch-keystore remove the.setting.name.to.remove
  95. ----------------------------------------------------------------
  96. [discrete]
  97. [[keystore-upgrade]]
  98. ==== Upgrade the keystore
  99. Occasionally, the internal format of the keystore changes. When {es} is
  100. installed from a package manager, an upgrade of the on-disk keystore to the new
  101. format is done during package upgrade. In other cases, {es} performs the upgrade
  102. during node startup. This requires that {es} has write permissions to the
  103. directory that contains the keystore. Alternatively, you can manually perform
  104. such an upgrade by using the `upgrade` command:
  105. [source,sh]
  106. ----------------------------------------------------------------
  107. bin/elasticsearch-keystore upgrade
  108. ----------------------------------------------------------------