| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245 | [[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}/targz.html#targz-layout[Directory layout of `.tar.gz` archives]* {ref}/zip-windows.html#windows-layout[Directory layout of Windows `.zip` 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/bin/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.[[plugin-management-custom-url]]=== 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.--Unix::To install a plugin from your local file system at `/path/to/plugin.zip`, you could run:+[source,shell]-----------------------------------sudo bin/elasticsearch-plugin install file:///path/to/plugin.zip-----------------------------------Windows::To install a plugin from your local file system at `C:\path\to\plugin.zip`, you could run:+[source,shell]-----------------------------------bin\elasticsearch-plugin install file:///C:/path/to/plugin.zip-----------------------------------+NOTE: Any path that contains spaces must be wrapped in quotes!+NOTE: If you are installing a plugin from the filesystem the plugin distributionmust not be contained in the `plugins` directory for the node that you areinstalling the plugin to or installation will fail.HTTP::To install a plugin from an HTTP URL:+[source,shell]-----------------------------------sudo bin/elasticsearch-plugin install http://some.domain/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://host/plugin.zip-------------------------------------[[mandatory-plugins]]=== 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.[[listing-removing-updating]]=== Listing, Removing and Updating 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 tocomplete the removal process.By default, plugin configuration files (if any) are preserved on disk; this isso that configuration is not lost while upgrading a plugin. If you wish topurge the configuration files while removing a plugin, use `-p` or `--purge`.This can option can be used after a plugin is removed to remove any lingeringconfiguration files.[float]=== Updating pluginsPlugins are built for a specific version of Elasticsearch, and therefore must be reinstalledeach time Elasticsearch is updated.[source,shell]-----------------------------------sudo bin/elasticsearch-plugin remove [pluginname]sudo bin/elasticsearch-plugin install [pluginname]-----------------------------------=== 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]=== Batch modeCertain plugins require more privileges than those provided by default in coreElasticsearch. These plugins will list the required privileges and ask theuser for confirmation before continuing with installation.When running the plugin install script from another program (e.g. installautomation scripts), the plugin script should detect that it is not beingcalled from the console and skip the confirmation response, automaticallygranting all requested permissions.  If console detection fails, then batchmode can be forced by specifying `-b` or `--batch` as follows:[source,shell]-----------------------------------sudo bin/elasticsearch-plugin install --batch [pluginname]-----------------------------------[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 ES_PATH_CONF=/path/to/conf/dir bin/elasticsearch-plugin install <plugin name>---------------------[float]=== Proxy settingsTo install a plugin via a proxy, you can add the proxy details to the`ES_JAVA_OPTS` environment variable with the Java settings `http.proxyHost`and `http.proxyPort` (or `https.proxyHost` and `https.proxyPort`):[source,shell]-----------------------------------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-----------------------------------Or on Windows:[source,shell]------------------------------------set 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------------------------------------=== Plugins directoryThe default location of the `plugins` directory depends on which package you install:* {ref}/targz.html#targz-layout[Directory layout of `.tar.gz` archives]* {ref}/zip-windows.html#windows-layout[Directory layout of Windows `.zip` archives]* {ref}/deb.html#deb-layout[Directory layout of Debian package]* {ref}/rpm.html#rpm-layout[Directory layout of RPM]
 |