2015-08-15 12:00:55 -04:00
|
|
|
[[plugin-management]]
|
|
|
|
== Plugin Management
|
|
|
|
|
|
|
|
The `plugin` script is used to install, list, and remove plugins. It is
|
|
|
|
located in the `$ES_HOME/bin` directory by default but it may be in a
|
2016-04-03 10:50:28 -04:00
|
|
|
different 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]
|
2015-08-15 12:00:55 -04:00
|
|
|
|
|
|
|
Run the following command to get usage instructions:
|
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2016-02-04 10:00:55 -05:00
|
|
|
sudo bin/elasticsearch-plugin -h
|
2015-08-15 12:00:55 -04:00
|
|
|
-----------------------------------
|
|
|
|
|
2015-09-15 11:33:39 -04:00
|
|
|
[IMPORTANT]
|
|
|
|
.Running as root
|
|
|
|
=====================
|
|
|
|
If Elasticsearch was installed using the deb or rpm package then run
|
2016-04-12 13:28:09 -04:00
|
|
|
`/usr/share/elasticsearch-plugin` as `root` so it can write to the appropriate files on disk.
|
2016-02-04 10:00:55 -05:00
|
|
|
Otherwise run `bin/elasticsearch-plugin` as the user that owns all of the Elasticsearch
|
2015-09-15 11:33:39 -04:00
|
|
|
files.
|
|
|
|
=====================
|
|
|
|
|
2015-08-15 12:00:55 -04:00
|
|
|
[[installation]]
|
|
|
|
=== Installing Plugins
|
|
|
|
|
|
|
|
The documentation for each plugin usually includes specific installation
|
|
|
|
instructions for that plugin, but below we document the various available
|
|
|
|
options:
|
|
|
|
|
|
|
|
[float]
|
|
|
|
=== Core Elasticsearch plugins
|
|
|
|
|
|
|
|
Core Elasticsearch plugins can be installed as follows:
|
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2016-02-04 10:00:55 -05:00
|
|
|
sudo bin/elasticsearch-plugin install [plugin_name]
|
2015-08-15 12:00:55 -04:00
|
|
|
-----------------------------------
|
|
|
|
|
|
|
|
For instance, to install the core <<analysis-icu,ICU plugin>>, just run the
|
|
|
|
following command:
|
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2016-02-04 10:00:55 -05:00
|
|
|
sudo bin/elasticsearch-plugin install analysis-icu
|
2015-08-15 12:00:55 -04:00
|
|
|
-----------------------------------
|
|
|
|
|
|
|
|
This command will install the version of the plugin that matches your
|
|
|
|
Elasticsearch version.
|
|
|
|
|
|
|
|
[float]
|
|
|
|
=== 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 10:00:55 -05:00
|
|
|
sudo bin/elasticsearch-plugin install [url] <1>
|
2015-08-15 12:00:55 -04:00
|
|
|
-----------------------------------
|
2015-08-07 10:05:39 -04:00
|
|
|
<1> must be a valid URL, the plugin name is determined from its descriptor.
|
2015-08-15 12:00:55 -04:00
|
|
|
|
|
|
|
For instance, to install a plugin from your local file system, you could run:
|
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2016-02-04 10:00:55 -05:00
|
|
|
sudo bin/elasticsearch-plugin install file:///path/to/plugin.zip
|
2015-08-15 12:00:55 -04:00
|
|
|
-----------------------------------
|
|
|
|
|
2015-11-09 08:33:05 -05: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:
|
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2016-05-09 13:06:18 -04:00
|
|
|
sudo ES_JAVA_OPTS="-Djavax.net.ssl.trustStore=/path/to/trustStore.jks" bin/elasticsearch-plugin install https://....
|
2015-11-09 08:33:05 -05:00
|
|
|
-----------------------------------
|
|
|
|
|
2015-08-15 12:00:55 -04:00
|
|
|
[[listing-removing]]
|
|
|
|
=== Listing and Removing Installed Plugins
|
|
|
|
|
|
|
|
[float]
|
|
|
|
=== Listing plugins
|
|
|
|
|
|
|
|
A list of the currently loaded plugins can be retrieved with the `list` option:
|
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2016-02-04 10:00:55 -05:00
|
|
|
sudo bin/elasticsearch-plugin list
|
2015-08-15 12:00:55 -04: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
|
|
|
|
|
|
|
|
[float]
|
|
|
|
=== Removing plugins
|
|
|
|
|
|
|
|
Plugins can be removed manually, by deleting the appropriate directory under
|
|
|
|
`plugins/`, or using the public script:
|
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2016-02-04 10:00:55 -05:00
|
|
|
sudo bin/elasticsearch-plugin remove [pluginname]
|
2015-08-15 12:00:55 -04:00
|
|
|
-----------------------------------
|
|
|
|
|
2015-10-06 20:09:00 -04:00
|
|
|
After a Java plugin has been removed, you will need to restart the node to complete the removal process.
|
|
|
|
|
2015-08-15 12:00:55 -04:00
|
|
|
=== Other command line parameters
|
|
|
|
|
|
|
|
The `plugin` scripts supports a number of other command line parameters:
|
|
|
|
|
|
|
|
[float]
|
|
|
|
=== Silent/Verbose mode
|
|
|
|
|
|
|
|
The `--verbose` parameter outputs more debug information, while the `--silent`
|
|
|
|
parameter turns off all output. The script may return 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 directory
|
|
|
|
|
|
|
|
If your `elasticsearch.yml` config file is in a custom location, you will need
|
|
|
|
to specify the path to the config file when using the `plugin` script. You
|
|
|
|
can do this as follows:
|
|
|
|
|
|
|
|
[source,sh]
|
|
|
|
---------------------
|
Bootstrap does not set system properties
Today, certain bootstrap properties are set and read via system
properties. This action-at-distance way of managing these properties is
rather confusing, and completely unnecessary. But another problem exists
with setting these as system properties. Namely, these system properties
are interpreted as Elasticsearch settings, not all of which are
registered. This leads to Elasticsearch failing to startup if any of
these special properties are set. Instead, these properties should be
kept as local as possible, and passed around as method parameters where
needed. This eliminates the action-at-distance way of handling these
properties, and eliminates the need to register these non-setting
properties. This commit does exactly that.
Additionally, today we use the "-D" command line flag to set the
properties, but this is confusing because "-D" is a special flag to the
JVM for setting system properties. This creates confusion because some
"-D" properties should be passed via arguments to the JVM (so via
ES_JAVA_OPTS), and some should be passed as arguments to
Elasticsearch. This commit changes the "-D" flag for Elasticsearch
settings to "-E".
2016-03-13 09:10:56 -04:00
|
|
|
sudo bin/elasticsearch-plugin -Ees.path.conf=/path/to/custom/config/dir install <plugin name>
|
2015-08-15 12:00:55 -04:00
|
|
|
---------------------
|
|
|
|
|
|
|
|
You can also set the `CONF_DIR` environment variable to the custom config
|
|
|
|
directory path.
|
|
|
|
|
|
|
|
[float]
|
|
|
|
=== Timeout settings
|
|
|
|
|
|
|
|
By default, the `plugin` script will wait indefinitely when downloading before
|
|
|
|
failing. The timeout parameter can be used to explicitly specify how long it
|
|
|
|
waits. Here is some examples of setting it to different values:
|
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
|
|
|
# Wait for 30 seconds before failing
|
2016-04-12 13:28:09 -04:00
|
|
|
sudo bin/elasticsearch-plugin install analysis-icu --timeout 30s
|
2015-08-15 12:00:55 -04:00
|
|
|
|
|
|
|
# Wait for 1 minute before failing
|
2016-04-12 13:28:09 -04:00
|
|
|
sudo bin/elasticsearch-plugin install analysis-icu --timeout 1m
|
2015-08-15 12:00:55 -04:00
|
|
|
|
|
|
|
# Wait forever (default)
|
2016-04-12 13:28:09 -04:00
|
|
|
sudo bin/elasticsearch-plugin install analysis-icu --timeout 0
|
2015-08-15 12:00:55 -04:00
|
|
|
-----------------------------------
|
|
|
|
|
|
|
|
[float]
|
|
|
|
=== Proxy settings
|
|
|
|
|
|
|
|
To install a plugin via a proxy, you can pass the proxy details in with the
|
|
|
|
Java settings `proxyHost` and `proxyPort`. On Unix based systems, these
|
|
|
|
options can be set on the command line:
|
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2016-05-09 13:06:18 -04:00
|
|
|
sudo ES_JAVA_OPTS="-DproxyHost=host_name -DproxyPort=port_number" bin/elasticsearch-plugin install mobz/elasticsearch-head
|
2015-08-15 12:00:55 -04:00
|
|
|
-----------------------------------
|
|
|
|
|
2016-04-03 10:52:37 -04:00
|
|
|
On Windows, they need to be added to the `ES_JAVA_OPTS` environment variable:
|
2015-08-15 12:00:55 -04:00
|
|
|
|
|
|
|
[source,shell]
|
|
|
|
-----------------------------------
|
2016-04-03 10:50:28 -04:00
|
|
|
set ES_JAVA_OPTS="-DproxyHost=host_name -DproxyPort=port_number"
|
2016-04-12 13:28:09 -04:00
|
|
|
bin/elasticsearch-plugin install analysis-icu
|
2015-08-15 12:00:55 -04:00
|
|
|
-----------------------------------
|
|
|
|
|
|
|
|
=== Settings related to plugins
|
|
|
|
|
|
|
|
[float]
|
|
|
|
=== Custom plugins directory
|
|
|
|
|
|
|
|
The `plugins` directory can be changed from the default by adding the
|
|
|
|
following to the `elasticsearch.yml` config file:
|
|
|
|
|
|
|
|
[source,yml]
|
|
|
|
---------------------
|
|
|
|
path.plugins: /path/to/custom/plugins/dir
|
|
|
|
---------------------
|
|
|
|
|
2016-04-03 10:50:28 -04:00
|
|
|
The 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]
|
2015-08-15 12:00:55 -04:00
|
|
|
|
|
|
|
[float]
|
|
|
|
=== Mandatory Plugins
|
|
|
|
|
|
|
|
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]
|
|
|
|
--------------------------------------------------
|
2016-04-12 13:28:09 -04:00
|
|
|
plugin.mandatory: analysis-icu,lang-js
|
2015-08-15 12:00:55 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
For safety reasons, a node will not start if it is missing a mandatory plugin.
|