plugin-script.asciidoc 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. [[plugin-management]]
  2. == Plugin Management
  3. The `plugin` script is used to install, list, and remove plugins. It is
  4. located in the `$ES_HOME/bin` directory by default but it may be in a
  5. different location depending on which Elasticsearch package you installed:
  6. * {ref}/zip-targz.html#zip-targz-layout[Directory layout of `.zip` and `.tar.gz` archives]
  7. * {ref}/deb.html#deb-layout[Directory layout of Debian package]
  8. * {ref}/rpm.html#rpm-layout[Directory layout of RPM]
  9. Run the following command to get usage instructions:
  10. [source,shell]
  11. -----------------------------------
  12. sudo bin/elasticsearch-plugin -h
  13. -----------------------------------
  14. // NOTCONSOLE
  15. [IMPORTANT]
  16. .Running as root
  17. =====================
  18. If Elasticsearch was installed using the deb or rpm package then run
  19. `/usr/share/elasticsearch-plugin` as `root` so it can write to the appropriate files on disk.
  20. Otherwise run `bin/elasticsearch-plugin` as the user that owns all of the Elasticsearch
  21. files.
  22. =====================
  23. [[installation]]
  24. === Installing Plugins
  25. The documentation for each plugin usually includes specific installation
  26. instructions for that plugin, but below we document the various available
  27. options:
  28. [float]
  29. === Core Elasticsearch plugins
  30. Core Elasticsearch plugins can be installed as follows:
  31. [source,shell]
  32. -----------------------------------
  33. sudo bin/elasticsearch-plugin install [plugin_name]
  34. -----------------------------------
  35. // NOTCONSOLE
  36. For instance, to install the core <<analysis-icu,ICU plugin>>, just run the
  37. following command:
  38. [source,shell]
  39. -----------------------------------
  40. sudo bin/elasticsearch-plugin install analysis-icu
  41. -----------------------------------
  42. // NOTCONSOLE
  43. This command will install the version of the plugin that matches your
  44. Elasticsearch version and also show a progress bar while downloading.
  45. [float]
  46. === Custom URL or file system
  47. A plugin can also be downloaded directly from a custom location by specifying the URL:
  48. [source,shell]
  49. -----------------------------------
  50. sudo bin/elasticsearch-plugin install [url] <1>
  51. -----------------------------------
  52. // NOTCONSOLE
  53. <1> must be a valid URL, the plugin name is determined from its descriptor.
  54. For instance, to install a plugin from your local file system, you could run:
  55. [source,shell]
  56. -----------------------------------
  57. sudo bin/elasticsearch-plugin install file:///path/to/plugin.zip
  58. -----------------------------------
  59. // NOTCONSOLE
  60. The plugin script will refuse to talk to an HTTPS URL with an untrusted
  61. certificate. To use a self-signed HTTPS cert, you will need to add the CA cert
  62. to a local Java truststore and pass the location to the script as follows:
  63. [source,shell]
  64. -----------------------------------
  65. sudo ES_JAVA_OPTS="-Djavax.net.ssl.trustStore=/path/to/trustStore.jks" bin/elasticsearch-plugin install https://....
  66. -----------------------------------
  67. // NOTCONSOLE
  68. [[listing-removing]]
  69. === Listing and Removing Installed Plugins
  70. [float]
  71. === Listing plugins
  72. A list of the currently loaded plugins can be retrieved with the `list` option:
  73. [source,shell]
  74. -----------------------------------
  75. sudo bin/elasticsearch-plugin list
  76. -----------------------------------
  77. // NOTCONSOLE
  78. Alternatively, use the {ref}/cluster-nodes-info.html[node-info API] to find
  79. out which plugins are installed on each node in the cluster
  80. [float]
  81. === Removing plugins
  82. Plugins can be removed manually, by deleting the appropriate directory under
  83. `plugins/`, or using the public script:
  84. [source,shell]
  85. -----------------------------------
  86. sudo bin/elasticsearch-plugin remove [pluginname]
  87. -----------------------------------
  88. // NOTCONSOLE
  89. After a Java plugin has been removed, you will need to restart the node to complete the removal process.
  90. === Other command line parameters
  91. The `plugin` scripts supports a number of other command line parameters:
  92. [float]
  93. === Silent/Verbose mode
  94. The `--verbose` parameter outputs more debug information, while the `--silent`
  95. parameter turns off all output including the progress bar. The script may
  96. return the following exit codes:
  97. [horizontal]
  98. `0`:: everything was OK
  99. `64`:: unknown command or incorrect option parameter
  100. `74`:: IO error
  101. `70`:: any other error
  102. [float]
  103. === Custom config directory
  104. If your `elasticsearch.yml` config file is in a custom location, you will need
  105. to specify the path to the config file when using the `plugin` script. You
  106. can do this as follows:
  107. [source,sh]
  108. ---------------------
  109. sudo bin/elasticsearch-plugin -Epath.conf=/path/to/custom/config/dir install <plugin name>
  110. ---------------------
  111. // NOTCONSOLE
  112. You can also set the `CONF_DIR` environment variable to the custom config
  113. directory path.
  114. [float]
  115. === Timeout settings
  116. By default, the `plugin` script will wait indefinitely when downloading before
  117. failing. The timeout parameter can be used to explicitly specify how long it
  118. waits. Here is some examples of setting it to different values:
  119. [source,shell]
  120. -----------------------------------
  121. # Wait for 30 seconds before failing
  122. sudo bin/elasticsearch-plugin install analysis-icu --timeout 30s
  123. # Wait for 1 minute before failing
  124. sudo bin/elasticsearch-plugin install analysis-icu --timeout 1m
  125. # Wait forever (default)
  126. sudo bin/elasticsearch-plugin install analysis-icu --timeout 0
  127. -----------------------------------
  128. // NOTCONSOLE
  129. [float]
  130. === Proxy settings
  131. To install a plugin via a proxy, you can add the proxy details to the
  132. `ES_JAVA_OPTS` environment variable with the Java settings `http.proxyHost`
  133. and `http.proxyPort` (or `https.proxyHost` and `https.proxyPort`):
  134. [source,shell]
  135. -----------------------------------
  136. sudo ES_JAVA_OPTS="-Dhttp.proxyHost=host_name -Dhttp.proxyPort=port_number -Dhttps.proxyHost=host_name -Dhttps.proxyPort=https_port_number" bin/elasticsearch-plugin install analysis-icu
  137. -----------------------------------
  138. // NOTCONSOLE
  139. Or on Windows:
  140. [source,shell]
  141. ------------------------------------
  142. set ES_JAVA_OPTS="-DproxyHost=host_name -DproxyPort=port_number -Dhttps.proxyHost=host_name -Dhttps.proxyPort=https_port_number"
  143. bin/elasticsearch-plugin install analysis-icu
  144. ------------------------------------
  145. // NOTCONSOLE
  146. === Plugins directory
  147. The default location of the `plugins` directory depends on which package you install:
  148. * {ref}/zip-targz.html#zip-targz-layout[Directory layout of `.zip` and `.tar.gz` archives]
  149. * {ref}/deb.html#deb-layout[Directory layout of Debian package]
  150. * {ref}/rpm.html#rpm-layout[Directory layout of RPM]
  151. [float]
  152. === Mandatory Plugins
  153. If you rely on some plugins, you can define mandatory plugins by adding
  154. `plugin.mandatory` setting to the `config/elasticsearch.yml` file, for
  155. example:
  156. [source,yaml]
  157. --------------------------------------------------
  158. plugin.mandatory: analysis-icu,lang-js
  159. --------------------------------------------------
  160. For safety reasons, a node will not start if it is missing a mandatory plugin.