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