| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 | [[plugin-management]]== Plugin ManagementThe `plugin` script is used to install, list, and remove plugins. It islocated in the `$ES_HOME/bin` directory by default but it may be in adifferent location depending on which Elasticsearch package you installed:* {ref}/zip-targz.html#zip-targz-layout[Directory layout of `.zip` and `.tar.gz` archives]* {ref}/deb.html#deb-layout[Directory layout of Debian package]* {ref}/rpm.html#rpm-layout[Directory layout of RPM]Run the following command to get usage instructions:[source,shell]-----------------------------------sudo bin/elasticsearch-plugin -h-----------------------------------[IMPORTANT].Running as root=====================If Elasticsearch was installed using the deb or rpm package then run`/usr/share/elasticsearch-plugin` as `root` so it can write to the appropriate files on disk.Otherwise run `bin/elasticsearch-plugin` as the user that owns all of the Elasticsearchfiles.=====================[[installation]]=== Installing PluginsThe documentation for each plugin usually includes specific installationinstructions for that plugin, but below we document the various availableoptions:[float]=== Core Elasticsearch pluginsCore Elasticsearch plugins can be installed as follows:[source,shell]-----------------------------------sudo bin/elasticsearch-plugin install [plugin_name]-----------------------------------For instance, to install the core <<analysis-icu,ICU plugin>>, just run thefollowing command:[source,shell]-----------------------------------sudo bin/elasticsearch-plugin install analysis-icu-----------------------------------This command will install the version of the plugin that matches yourElasticsearch version and also show a progress bar while downloading.[float]=== Custom URL or file systemA plugin can also be downloaded directly from a custom location by specifying the URL:[source,shell]-----------------------------------sudo bin/elasticsearch-plugin install [url] <1>-----------------------------------<1> must be a valid URL, the plugin name is determined from its descriptor.For instance, to install a plugin from your local file system, you could run:[source,shell]-----------------------------------sudo bin/elasticsearch-plugin install file:///path/to/plugin.zip-----------------------------------The plugin script will refuse to talk to an HTTPS URL with an untrustedcertificate. To use a self-signed HTTPS cert, you will need to add the CA certto a local Java truststore and pass the location to the script as follows:[source,shell]-----------------------------------sudo ES_JAVA_OPTS="-Djavax.net.ssl.trustStore=/path/to/trustStore.jks" bin/elasticsearch-plugin install https://....-----------------------------------[[listing-removing]]=== Listing and Removing Installed Plugins[float]=== Listing pluginsA list of the currently loaded plugins can be retrieved with the `list` option:[source,shell]-----------------------------------sudo bin/elasticsearch-plugin list-----------------------------------Alternatively, use the {ref}/cluster-nodes-info.html[node-info API] to findout which plugins are installed on each node in the cluster[float]=== Removing pluginsPlugins can be removed manually, by deleting the appropriate directory under`plugins/`, or using the public script:[source,shell]-----------------------------------sudo bin/elasticsearch-plugin remove [pluginname]-----------------------------------After a Java plugin has been removed, you will need to restart the node to complete the removal process.=== Other command line parametersThe `plugin` scripts supports a number of other command line parameters:[float]=== Silent/Verbose modeThe `--verbose` parameter outputs more debug information, while the `--silent`parameter turns off all output including the progress bar. The script mayreturn the following exit codes:[horizontal]`0`:: everything was OK`64`:: unknown command or incorrect option parameter`74`:: IO error`70`:: any other error[float]=== Custom config directoryIf your `elasticsearch.yml` config file is in a custom location, you will needto specify the path to the config file when using the `plugin` script.  Youcan do this as follows:[source,sh]---------------------sudo bin/elasticsearch-plugin -Epath.conf=/path/to/custom/config/dir install <plugin name>---------------------You can also set the `CONF_DIR` environment variable to the custom configdirectory path.[float]=== Timeout settingsBy default, the `plugin` script will wait indefinitely when downloading beforefailing. The timeout parameter can be used to explicitly specify how long itwaits. Here is some examples of setting it to different values:[source,shell]-----------------------------------# Wait for 30 seconds before failingsudo bin/elasticsearch-plugin install analysis-icu --timeout 30s# Wait for 1 minute before failingsudo bin/elasticsearch-plugin install analysis-icu --timeout 1m# Wait forever (default)sudo bin/elasticsearch-plugin install analysis-icu --timeout 0-----------------------------------[float]=== Proxy settingsTo install a plugin via a proxy, you can pass the proxy details in with theJava settings `proxyHost` and `proxyPort`. On Unix based systems, theseoptions can be set on the command line:[source,shell]-----------------------------------sudo ES_JAVA_OPTS="-DproxyHost=host_name -DproxyPort=port_number" bin/elasticsearch-plugin install mobz/elasticsearch-head-----------------------------------On Windows, they need to be added to the `ES_JAVA_OPTS` environment variable:[source,shell]-----------------------------------set ES_JAVA_OPTS="-DproxyHost=host_name -DproxyPort=port_number"bin/elasticsearch-plugin install analysis-icu-----------------------------------=== Plugins directoryThe default location of the `plugins` directory depends on which package you install:* {ref}/zip-targz.html#zip-targz-layout[Directory layout of `.zip` and `.tar.gz` archives]* {ref}/deb.html#deb-layout[Directory layout of Debian package]* {ref}/rpm.html#rpm-layout[Directory layout of RPM][float]=== Mandatory PluginsIf you rely on some plugins, you can define mandatory plugins by adding`plugin.mandatory` setting to the `config/elasticsearch.yml` file, forexample:[source,yaml]--------------------------------------------------plugin.mandatory: analysis-icu,lang-js--------------------------------------------------For safety reasons, a node will not start if it is missing a mandatory plugin.
 |