1
0

plugin-script.asciidoc 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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. {ref}/setup-dir-layout.html[different location] if you installed Elasticsearch
  6. with an RPM or deb package.
  7. Run the following command to get usage instructions:
  8. [source,shell]
  9. -----------------------------------
  10. sudo bin/plugin -h
  11. -----------------------------------
  12. [[installation]]
  13. === Installing Plugins
  14. The documentation for each plugin usually includes specific installation
  15. instructions for that plugin, but below we document the various available
  16. options:
  17. [float]
  18. === Core Elasticsearch plugins
  19. Core Elasticsearch plugins can be installed as follows:
  20. [source,shell]
  21. -----------------------------------
  22. sudo bin/plugin install [plugin_name]
  23. -----------------------------------
  24. For instance, to install the core <<analysis-icu,ICU plugin>>, just run the
  25. following command:
  26. [source,shell]
  27. -----------------------------------
  28. sudo bin/plugin install analysis-icu
  29. -----------------------------------
  30. This command will install the version of the plugin that matches your
  31. Elasticsearch version.
  32. [float]
  33. === Community and non-core plugins
  34. Non-core plugins provided by Elasticsearch, or plugins provided by the
  35. community, can be installed from `download.elastic.co`, from Maven (Central
  36. and Sonatype), or from GitHub. In this case, the command is as follows:
  37. [source,shell]
  38. -----------------------------------
  39. sudo bin/plugin install [org]/[user|component]/[version]
  40. -----------------------------------
  41. For instance, to install the https://github.com/lmenezes/elasticsearch-kopf[Kopf]
  42. plugin from GitHub, run one of the following commands:
  43. [source,shell]
  44. -----------------------------------
  45. sudo bin/plugin install lmenezes/elasticsearch-kopf <1>
  46. sudo bin/plugin install lmenezes/elasticsearch-kopf/1.x <2>
  47. -----------------------------------
  48. <1> Installs the latest version from GitHub.
  49. <2> Installs the 1.x version from GitHub.
  50. When installing from Maven Central/Sonatype, `[org]` should be replaced by
  51. the artifact `groupId`, and `[user|component]` by the `artifactId`. For
  52. instance, to install the
  53. https://github.com/elastic/elasticsearch-mapper-attachments[mapper attachment]
  54. plugin from Sonatype, run:
  55. [source,shell]
  56. -----------------------------------
  57. sudo bin/plugin install org.elasticsearch/elasticsearch-mapper-attachments/2.6.0 <1>
  58. -----------------------------------
  59. <1> When installing from `download.elastic.co` or from Maven Central/Sonatype, the
  60. version is required.
  61. [float]
  62. === Custom URL or file system
  63. A plugin can also be downloaded directly from a custom location by specifying the URL:
  64. [source,shell]
  65. -----------------------------------
  66. sudo bin/plugin install [plugin-name] --url [url] <1>
  67. -----------------------------------
  68. <1> Both the URL and the plugin name must be specified.
  69. For instance, to install a plugin from your local file system, you could run:
  70. [source,shell]
  71. -----------------------------------
  72. sudo bin/plugin install my_plugin --url file:/path/to/plugin.zip
  73. -----------------------------------
  74. [[listing-removing]]
  75. === Listing and Removing Installed Plugins
  76. [float]
  77. === Listing plugins
  78. A list of the currently loaded plugins can be retrieved with the `list` option:
  79. [source,shell]
  80. -----------------------------------
  81. sudo bin/plugin list
  82. -----------------------------------
  83. Alternatively, use the {ref}/cluster-nodes-info.html[node-info API] to find
  84. out which plugins are installed on each node in the cluster
  85. [float]
  86. === Removing plugins
  87. Plugins can be removed manually, by deleting the appropriate directory under
  88. `plugins/`, or using the public script:
  89. [source,shell]
  90. -----------------------------------
  91. sudo bin/plugin remove [pluginname]
  92. -----------------------------------
  93. === Other command line parameters
  94. The `plugin` scripts supports a number of other command line parameters:
  95. [float]
  96. === Silent/Verbose mode
  97. The `--verbose` parameter outputs more debug information, while the `--silent`
  98. parameter turns off all output. The script may return the following exit
  99. codes:
  100. [horizontal]
  101. `0`:: everything was OK
  102. `64`:: unknown command or incorrect option parameter
  103. `74`:: IO error
  104. `70`:: any other error
  105. [float]
  106. === Custom config directory
  107. If your `elasticsearch.yml` config file is in a custom location, you will need
  108. to specify the path to the config file when using the `plugin` script. You
  109. can do this as follows:
  110. [source,sh]
  111. ---------------------
  112. sudo bin/plugin -Des.path.conf=/path/to/custom/config/dir install <plugin name>
  113. ---------------------
  114. You can also set the `CONF_DIR` environment variable to the custom config
  115. directory path.
  116. [float]
  117. === Timeout settings
  118. By default, the `plugin` script will wait indefinitely when downloading before
  119. failing. The timeout parameter can be used to explicitly specify how long it
  120. waits. Here is some examples of setting it to different values:
  121. [source,shell]
  122. -----------------------------------
  123. # Wait for 30 seconds before failing
  124. sudo bin/plugin install mobz/elasticsearch-head --timeout 30s
  125. # Wait for 1 minute before failing
  126. sudo bin/plugin install mobz/elasticsearch-head --timeout 1m
  127. # Wait forever (default)
  128. sudo bin/plugin install mobz/elasticsearch-head --timeout 0
  129. -----------------------------------
  130. [float]
  131. === Proxy settings
  132. To install a plugin via a proxy, you can pass the proxy details in with the
  133. Java settings `proxyHost` and `proxyPort`. On Unix based systems, these
  134. options can be set on the command line:
  135. [source,shell]
  136. -----------------------------------
  137. sudo bin/plugin install mobz/elasticsearch-head -DproxyHost=host_name -DproxyPort=port_number
  138. -----------------------------------
  139. On Windows, they need to be added to the `JAVA_OPTS` environment variable:
  140. [source,shell]
  141. -----------------------------------
  142. set JAVA_OPTS="-DproxyHost=host_name -DproxyPort=port_number"
  143. bin/plugin install mobz/elasticsearch-head
  144. -----------------------------------
  145. === Settings related to plugins
  146. [float]
  147. === Custom plugins directory
  148. The `plugins` directory can be changed from the default by adding the
  149. following to the `elasticsearch.yml` config file:
  150. [source,yml]
  151. ---------------------
  152. path.plugins: /path/to/custom/plugins/dir
  153. ---------------------
  154. The default location of the `plugins` directory depends on
  155. {ref}/setup-dir-layout.html[which package you install].
  156. [float]
  157. === Mandatory Plugins
  158. If you rely on some plugins, you can define mandatory plugins by adding
  159. `plugin.mandatory` setting to the `config/elasticsearch.yml` file, for
  160. example:
  161. [source,yaml]
  162. --------------------------------------------------
  163. plugin.mandatory: mapper-attachments,lang-groovy
  164. --------------------------------------------------
  165. For safety reasons, a node will not start if it is missing a mandatory plugin.