2015-08-16 00:00:55 +08:00
|
|
|
[[plugin-management]]
|
2023-02-13 21:15:12 +08:00
|
|
|
== Plugin management
|
|
|
|
|
|
|
|
[discrete]
|
|
|
|
=== Managing plugins on {ess}
|
|
|
|
|
|
|
|
Refer to the {cloud}/ec-adding-plugins.html[{ess} documentation] for information
|
|
|
|
about managing plugins on {ecloud}.
|
|
|
|
|
|
|
|
[discrete]
|
|
|
|
=== Managing plugins for self-managed deployments
|
2015-08-16 00:00:55 +08:00
|
|
|
|
2021-11-18 05:11:00 +08:00
|
|
|
Use the `elasticsearch-plugin` command line tool to install, list, and remove plugins. It is
|
2015-08-16 00:00:55 +08:00
|
|
|
located in the `$ES_HOME/bin` directory by default but it may be in a
|
2016-04-03 22:50:28 +08:00
|
|
|
different location depending on which Elasticsearch package you installed:
|
|
|
|
|
2019-03-29 22:18:59 +08:00
|
|
|
* {ref}/targz.html#targz-layout[Directory layout of `.tar.gz` archives]
|
|
|
|
* {ref}/zip-windows.html#windows-layout[Directory layout of Windows `.zip` archives]
|
2016-04-03 22:50:28 +08:00
|
|
|
* {ref}/deb.html#deb-layout[Directory layout of Debian package]
|
|
|
|
* {ref}/rpm.html#rpm-layout[Directory layout of RPM]
|
2015-08-16 00:00:55 +08:00
|
|
|
|
|
|
|
Run the following command to get usage instructions:
|
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2016-02-04 23:00:55 +08:00
|
|
|
sudo bin/elasticsearch-plugin -h
|
2015-08-16 00:00:55 +08:00
|
|
|
-----------------------------------
|
|
|
|
|
2015-09-15 23:33:39 +08:00
|
|
|
[IMPORTANT]
|
|
|
|
.Running as root
|
|
|
|
=====================
|
|
|
|
If Elasticsearch was installed using the deb or rpm package then run
|
2017-03-17 22:56:31 +08:00
|
|
|
`/usr/share/elasticsearch/bin/elasticsearch-plugin` as `root` so it can write to the appropriate files on disk.
|
2016-02-04 23:00:55 +08:00
|
|
|
Otherwise run `bin/elasticsearch-plugin` as the user that owns all of the Elasticsearch
|
2015-09-15 23:33:39 +08:00
|
|
|
files.
|
|
|
|
=====================
|
|
|
|
|
2021-11-18 05:11:00 +08:00
|
|
|
[discrete]
|
|
|
|
[[plugin-management-docker]]
|
|
|
|
=== Docker
|
|
|
|
|
|
|
|
If you run {es} using Docker, you can manage plugins using a
|
|
|
|
<<manage-plugins-using-configuration-file,configuration file>>.
|
|
|
|
|
2015-08-16 00:00:55 +08:00
|
|
|
[[installation]]
|
2023-02-13 21:15:12 +08:00
|
|
|
=== Installing plugins
|
2015-08-16 00:00:55 +08:00
|
|
|
|
|
|
|
The documentation for each plugin usually includes specific installation
|
|
|
|
instructions for that plugin, but below we document the various available
|
|
|
|
options:
|
|
|
|
|
2020-07-23 23:48:22 +08:00
|
|
|
[discrete]
|
2015-08-16 00:00:55 +08:00
|
|
|
=== Core Elasticsearch plugins
|
|
|
|
|
|
|
|
Core Elasticsearch plugins can be installed as follows:
|
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2016-02-04 23:00:55 +08:00
|
|
|
sudo bin/elasticsearch-plugin install [plugin_name]
|
2015-08-16 00:00:55 +08:00
|
|
|
-----------------------------------
|
|
|
|
|
|
|
|
For instance, to install the core <<analysis-icu,ICU plugin>>, just run the
|
|
|
|
following command:
|
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2016-02-04 23:00:55 +08:00
|
|
|
sudo bin/elasticsearch-plugin install analysis-icu
|
2015-08-16 00:00:55 +08:00
|
|
|
-----------------------------------
|
|
|
|
|
|
|
|
This command will install the version of the plugin that matches your
|
2016-06-29 22:44:12 +08:00
|
|
|
Elasticsearch version and also show a progress bar while downloading.
|
2015-08-16 00:00:55 +08:00
|
|
|
|
2016-09-19 21:04:29 +08:00
|
|
|
[[plugin-management-custom-url]]
|
2015-08-16 00:00:55 +08:00
|
|
|
=== Custom URL or file system
|
|
|
|
|
|
|
|
A plugin can also be downloaded directly from a custom location by specifying the URL:
|
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2016-02-04 23:00:55 +08:00
|
|
|
sudo bin/elasticsearch-plugin install [url] <1>
|
2015-08-16 00:00:55 +08:00
|
|
|
-----------------------------------
|
2015-08-07 22:05:39 +08:00
|
|
|
<1> must be a valid URL, the plugin name is determined from its descriptor.
|
2015-08-16 00:00:55 +08:00
|
|
|
|
2017-10-11 03:05:26 +08:00
|
|
|
--
|
2017-10-10 23:31:44 +08:00
|
|
|
Unix::
|
|
|
|
To install a plugin from your local file system at `/path/to/plugin.zip`, you could run:
|
|
|
|
+
|
2015-08-16 00:00:55 +08:00
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2016-02-04 23:00:55 +08:00
|
|
|
sudo bin/elasticsearch-plugin install file:///path/to/plugin.zip
|
2015-08-16 00:00:55 +08:00
|
|
|
-----------------------------------
|
|
|
|
|
2017-10-10 23:31:44 +08:00
|
|
|
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
|
|
|
|
-----------------------------------
|
|
|
|
+
|
2017-10-11 03:05:26 +08:00
|
|
|
NOTE: Any path that contains spaces must be wrapped in quotes!
|
2017-11-16 02:33:59 +08:00
|
|
|
+
|
|
|
|
NOTE: If you are installing a plugin from the filesystem the plugin distribution
|
|
|
|
must not be contained in the `plugins` directory for the node that you are
|
|
|
|
installing the plugin to or installation will fail.
|
2017-10-10 23:31:44 +08:00
|
|
|
|
|
|
|
HTTP::
|
2018-09-18 03:35:55 +08:00
|
|
|
To install a plugin from an HTTP URL:
|
2017-10-10 23:31:44 +08:00
|
|
|
+
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2020-08-01 03:58:38 +08:00
|
|
|
sudo bin/elasticsearch-plugin install https://some.domain/path/to/plugin.zip
|
2017-10-10 23:31:44 +08:00
|
|
|
-----------------------------------
|
|
|
|
+
|
2015-11-09 21:33:05 +08:00
|
|
|
The plugin script will refuse to talk to an HTTPS URL with an untrusted
|
|
|
|
certificate. To use a self-signed HTTPS cert, you will need to add the CA cert
|
|
|
|
to a local Java truststore and pass the location to the script as follows:
|
2017-10-10 23:31:44 +08:00
|
|
|
+
|
2015-11-09 21:33:05 +08:00
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2022-08-04 21:04:28 +08:00
|
|
|
sudo CLI_JAVA_OPTS="-Djavax.net.ssl.trustStore=/path/to/trustStore.jks" bin/elasticsearch-plugin install https://host/plugin.zip
|
2015-11-09 21:33:05 +08:00
|
|
|
-----------------------------------
|
2017-10-11 03:05:26 +08:00
|
|
|
--
|
2015-11-09 21:33:05 +08:00
|
|
|
|
2020-01-15 01:12:20 +08:00
|
|
|
[[installing-multiple-plugins]]
|
|
|
|
=== Installing multiple plugins
|
|
|
|
|
|
|
|
Multiple plugins can be installed in one invocation as follows:
|
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
|
|
|
sudo bin/elasticsearch-plugin install [plugin_id] [plugin_id] ... [plugin_id]
|
|
|
|
-----------------------------------
|
|
|
|
|
|
|
|
Each `plugin_id` can be any valid form for installing a single plugin (e.g., the
|
|
|
|
name of a core plugin, or a custom URL).
|
|
|
|
|
2022-01-10 18:45:42 +08:00
|
|
|
For instance, to install the core <<analysis-icu,ICU plugin>>, run the following command:
|
2020-01-15 01:12:20 +08:00
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2022-01-10 18:45:42 +08:00
|
|
|
sudo bin/elasticsearch-plugin install analysis-icu
|
2020-01-15 01:12:20 +08:00
|
|
|
-----------------------------------
|
|
|
|
|
|
|
|
This command will install the versions of the plugins that matches your
|
|
|
|
Elasticsearch version. The installation will be treated as a transaction, so
|
|
|
|
that all the plugins will be installed, or none of the plugins will be installed
|
|
|
|
if any installation fails.
|
|
|
|
|
2019-08-30 23:00:42 +08:00
|
|
|
[[mandatory-plugins]]
|
2023-02-13 21:15:12 +08:00
|
|
|
=== Mandatory plugins
|
2019-08-30 23:00:42 +08:00
|
|
|
|
|
|
|
If you rely on some plugins, you can define mandatory plugins by adding
|
|
|
|
`plugin.mandatory` setting to the `config/elasticsearch.yml` file, for
|
|
|
|
example:
|
|
|
|
|
|
|
|
[source,yaml]
|
|
|
|
--------------------------------------------------
|
|
|
|
plugin.mandatory: analysis-icu,lang-js
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
For safety reasons, a node will not start if it is missing a mandatory plugin.
|
|
|
|
|
2017-03-22 02:59:21 +08:00
|
|
|
[[listing-removing-updating]]
|
2023-02-13 21:15:12 +08:00
|
|
|
=== Listing, removing and updating installed plugins
|
2015-08-16 00:00:55 +08:00
|
|
|
|
2020-07-23 23:48:22 +08:00
|
|
|
[discrete]
|
2015-08-16 00:00:55 +08:00
|
|
|
=== Listing plugins
|
|
|
|
|
|
|
|
A list of the currently loaded plugins can be retrieved with the `list` option:
|
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2016-02-04 23:00:55 +08:00
|
|
|
sudo bin/elasticsearch-plugin list
|
2015-08-16 00:00:55 +08:00
|
|
|
-----------------------------------
|
|
|
|
|
|
|
|
Alternatively, use the {ref}/cluster-nodes-info.html[node-info API] to find
|
|
|
|
out which plugins are installed on each node in the cluster
|
|
|
|
|
2020-07-23 23:48:22 +08:00
|
|
|
[discrete]
|
2015-08-16 00:00:55 +08:00
|
|
|
=== Removing plugins
|
|
|
|
|
|
|
|
Plugins can be removed manually, by deleting the appropriate directory under
|
|
|
|
`plugins/`, or using the public script:
|
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2016-02-04 23:00:55 +08:00
|
|
|
sudo bin/elasticsearch-plugin remove [pluginname]
|
2015-08-16 00:00:55 +08:00
|
|
|
-----------------------------------
|
|
|
|
|
2017-06-01 20:53:39 +08:00
|
|
|
After a Java plugin has been removed, you will need to restart the node to
|
|
|
|
complete the removal process.
|
|
|
|
|
|
|
|
By default, plugin configuration files (if any) are preserved on disk; this is
|
|
|
|
so that configuration is not lost while upgrading a plugin. If you wish to
|
|
|
|
purge 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 lingering
|
|
|
|
configuration files.
|
2015-10-07 08:09:00 +08:00
|
|
|
|
2022-11-30 01:40:01 +08:00
|
|
|
[discrete]
|
2021-02-24 22:10:06 +08:00
|
|
|
[[removing-multiple-plugins]]
|
|
|
|
=== Removing multiple plugins
|
|
|
|
|
|
|
|
Multiple plugins can be removed in one invocation as follows:
|
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
|
|
|
sudo bin/elasticsearch-plugin remove [pluginname] [pluginname] ... [pluginname]
|
|
|
|
-----------------------------------
|
|
|
|
|
2020-07-23 23:48:22 +08:00
|
|
|
[discrete]
|
2017-03-22 02:59:21 +08:00
|
|
|
=== Updating plugins
|
|
|
|
|
2023-02-13 21:15:12 +08:00
|
|
|
Except for text analysis plugins that are created using the
|
|
|
|
<<creating-stable-plugins,stable plugin API>>, plugins are built for a specific
|
|
|
|
version of {es}, and must be reinstalled each time {es} is updated.
|
2017-03-22 02:59:21 +08:00
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
|
|
|
sudo bin/elasticsearch-plugin remove [pluginname]
|
|
|
|
sudo bin/elasticsearch-plugin install [pluginname]
|
|
|
|
-----------------------------------
|
|
|
|
|
2015-08-16 00:00:55 +08:00
|
|
|
=== Other command line parameters
|
|
|
|
|
|
|
|
The `plugin` scripts supports a number of other command line parameters:
|
|
|
|
|
2020-07-23 23:48:22 +08:00
|
|
|
[discrete]
|
2023-02-13 21:15:12 +08:00
|
|
|
=== Silent/verbose mode
|
2015-08-16 00:00:55 +08:00
|
|
|
|
|
|
|
The `--verbose` parameter outputs more debug information, while the `--silent`
|
2016-06-29 22:44:12 +08:00
|
|
|
parameter turns off all output including the progress bar. The script may
|
|
|
|
return the following exit codes:
|
2015-08-16 00:00:55 +08:00
|
|
|
|
|
|
|
[horizontal]
|
|
|
|
`0`:: everything was OK
|
|
|
|
`64`:: unknown command or incorrect option parameter
|
|
|
|
`74`:: IO error
|
|
|
|
`70`:: any other error
|
|
|
|
|
2020-07-23 23:48:22 +08:00
|
|
|
[discrete]
|
2016-11-24 23:41:05 +08:00
|
|
|
=== Batch mode
|
|
|
|
|
|
|
|
Certain plugins require more privileges than those provided by default in core
|
|
|
|
Elasticsearch. These plugins will list the required privileges and ask the
|
|
|
|
user for confirmation before continuing with installation.
|
|
|
|
|
|
|
|
When running the plugin install script from another program (e.g. install
|
|
|
|
automation scripts), the plugin script should detect that it is not being
|
|
|
|
called from the console and skip the confirmation response, automatically
|
2021-03-31 21:57:47 +08:00
|
|
|
granting all requested permissions. If console detection fails, then batch
|
2016-11-24 23:41:05 +08:00
|
|
|
mode can be forced by specifying `-b` or `--batch` as follows:
|
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
|
|
|
sudo bin/elasticsearch-plugin install --batch [pluginname]
|
|
|
|
-----------------------------------
|
|
|
|
|
2020-07-23 23:48:22 +08:00
|
|
|
[discrete]
|
2015-08-16 00:00:55 +08:00
|
|
|
=== Custom config directory
|
|
|
|
|
|
|
|
If your `elasticsearch.yml` config file is in a custom location, you will need
|
2021-03-31 21:57:47 +08:00
|
|
|
to specify the path to the config file when using the `plugin` script. You
|
2015-08-16 00:00:55 +08:00
|
|
|
can do this as follows:
|
|
|
|
|
|
|
|
[source,sh]
|
|
|
|
---------------------
|
2017-08-15 05:19:06 +08:00
|
|
|
sudo ES_PATH_CONF=/path/to/conf/dir bin/elasticsearch-plugin install <plugin name>
|
2015-08-16 00:00:55 +08:00
|
|
|
---------------------
|
|
|
|
|
2020-07-23 23:48:22 +08:00
|
|
|
[discrete]
|
2015-08-16 00:00:55 +08:00
|
|
|
=== Proxy settings
|
|
|
|
|
2016-07-25 21:15:09 +08:00
|
|
|
To install a plugin via a proxy, you can add the proxy details to the
|
2022-08-04 21:04:28 +08:00
|
|
|
`CLI_JAVA_OPTS` environment variable with the Java settings `http.proxyHost`
|
2016-07-25 21:15:09 +08:00
|
|
|
and `http.proxyPort` (or `https.proxyHost` and `https.proxyPort`):
|
2015-08-16 00:00:55 +08:00
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2022-08-04 21:04:28 +08:00
|
|
|
sudo CLI_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
|
2015-08-16 00:00:55 +08:00
|
|
|
-----------------------------------
|
|
|
|
|
2016-07-25 21:15:09 +08:00
|
|
|
Or on Windows:
|
2015-08-16 00:00:55 +08:00
|
|
|
|
|
|
|
[source,shell]
|
2016-07-25 21:15:09 +08:00
|
|
|
------------------------------------
|
2022-08-04 21:04:28 +08:00
|
|
|
set CLI_JAVA_OPTS="-Dhttp.proxyHost=host_name -Dhttp.proxyPort=port_number -Dhttps.proxyHost=host_name -Dhttps.proxyPort=https_port_number"
|
2017-03-27 19:40:11 +08:00
|
|
|
bin\elasticsearch-plugin install analysis-icu
|
2016-07-25 21:15:09 +08:00
|
|
|
------------------------------------
|
2015-08-16 00:00:55 +08:00
|
|
|
|
2016-05-26 21:37:51 +08:00
|
|
|
=== Plugins directory
|
2015-08-16 00:00:55 +08:00
|
|
|
|
2016-04-03 22:50:28 +08:00
|
|
|
The default location of the `plugins` directory depends on which package you install:
|
|
|
|
|
2019-03-29 22:44:08 +08:00
|
|
|
* {ref}/targz.html#targz-layout[Directory layout of `.tar.gz` archives]
|
|
|
|
* {ref}/zip-windows.html#windows-layout[Directory layout of Windows `.zip` archives]
|
2016-04-03 22:50:28 +08:00
|
|
|
* {ref}/deb.html#deb-layout[Directory layout of Debian package]
|
|
|
|
* {ref}/rpm.html#rpm-layout[Directory layout of RPM]
|
2021-11-18 05:11:00 +08:00
|
|
|
|
|
|
|
|
|
|
|
[[manage-plugins-using-configuration-file]]
|
|
|
|
=== Manage plugins using a configuration file
|
|
|
|
|
|
|
|
[IMPORTANT]
|
|
|
|
.Docker only
|
|
|
|
=====================
|
|
|
|
This feature is only available for https://www.docker.elastic.co/[official {es}
|
|
|
|
Docker images]. Other {es} distributions will not start with a
|
|
|
|
plugin configuration file.
|
|
|
|
=====================
|
|
|
|
|
|
|
|
If you run {es} using Docker, you can manage plugins using a declarative configuration file.
|
|
|
|
When {es} starts up, it will compare the plugins in the file with those
|
|
|
|
that are currently installed, and add or remove plugins as required. {es}
|
2022-03-08 01:29:58 +08:00
|
|
|
will also upgrade official plugins when you upgrade {es} itself.
|
2021-11-18 05:11:00 +08:00
|
|
|
|
|
|
|
The file is called `elasticsearch-plugins.yml`, and must be placed in the
|
|
|
|
Elasticsearch configuration directory, alongside `elasticsearch.yml`. Here
|
|
|
|
is an example:
|
|
|
|
|
|
|
|
[source,yaml]
|
|
|
|
----
|
|
|
|
plugins:
|
|
|
|
- id: analysis-icu
|
|
|
|
- id: repository-azure
|
|
|
|
- id: custom-mapper
|
|
|
|
location: https://example.com/archive/custom-mapper-1.0.0.zip
|
|
|
|
----
|
|
|
|
|
|
|
|
This example installs the official `analysis-icu` and
|
|
|
|
`repository-azure` plugins, and one unofficial plugin. Every plugin must provide
|
|
|
|
an `id`. Unofficial plugins must also provide a `location`. This is
|
|
|
|
typically a URL, but Maven coordinates are also supported. The downloaded
|
|
|
|
plugin's name must match the ID in the configuration file.
|
|
|
|
|
|
|
|
While {es} will respect the
|
|
|
|
https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html[standard
|
|
|
|
Java proxy system properties] when downloading plugins, you can also configure an
|
|
|
|
HTTP proxy to use explicitly in the configuration file. For example:
|
|
|
|
|
|
|
|
[source,yaml]
|
|
|
|
----
|
|
|
|
plugins:
|
|
|
|
- id: custom-mapper
|
|
|
|
location: https://example.com/archive/custom-mapper-1.0.0.zip
|
|
|
|
proxy: proxy.example.com:8443
|
|
|
|
----
|