Plugins

edit

Plugins

edit

Plugins are a way to enhance the basic elasticsearch functionality in a custom manner. They range from adding custom mapping types, custom analyzers (in a more built in fashion), native scripts, custom discovery and more.

Installing plugins

edit

Installing plugins can either be done manually by placing them under the plugins directory, or using the plugin script. Several plugins can be found under the elasticsearch organization in GitHub, starting with elasticsearch-.

Installing plugins typically take the following form:

plugin --install <org>/<user/component>/<version>

The plugins will be automatically downloaded in this case from download.elastic.co, and in case they don’t exist there, from maven (central and sonatype).

Note that when the plugin is located in maven central or sonatype repository, <org> is the artifact groupId and <user/component> is the artifactId.

A plugin can also be installed directly by specifying the URL for it, for example:

bin/plugin --url file:///path/to/plugin --install plugin-name

You can run bin/plugin -h.

Site Plugins

edit

Plugins can have "sites" in them, any plugin that exists under the plugins directory with a _site directory, its content will be statically served when hitting /_plugin/[plugin_name]/ url. Those can be added even after the process has started.

Installed plugins that do not contain any java related content, will automatically be detected as site plugins, and their content will be moved under _site.

The ability to install plugins from Github allows to easily install site plugins hosted there by downloading the actual repo, for example, running:

bin/plugin --install mobz/elasticsearch-head
bin/plugin --install lukas-vlcek/bigdesk

Will install both of those site plugins, with elasticsearch-head available under http://localhost:9200/_plugin/head/ and bigdesk available under http://localhost:9200/_plugin/bigdesk/.

Mandatory Plugins

edit

If you rely on some plugins, you can define mandatory plugins using the plugin.mandatory attribute, for example, here is a sample config:

plugin.mandatory: mapper-attachments,lang-groovy

For safety reasons, if a mandatory plugin is not installed, the node will not start.

Installed Plugins

edit

A list of the currently loaded plugins can be retrieved using the Node Info API.

Removing plugins

edit

Removing plugins can either be done manually by removing them under the plugins directory, or using the plugin script.

Removing plugins typically take the following form:

plugin --remove <pluginname>

Silent/Verbose mode

edit

When running the plugin script, you can get more information (debug mode) using --verbose. On the opposite, if you want plugin script to be silent, use --silent option.

Note that exit codes could be:

  • 0: everything was OK
  • 64: unknown command or incorrect option parameter
  • 74: IO error
  • 70: other errors
bin/plugin --install mobz/elasticsearch-head --verbose
plugin --remove head --silent

Timeout settings

edit

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:

# Wait for 30 seconds before failing
bin/plugin --install mobz/elasticsearch-head --timeout 30s

# Wait for 1 minute before failing
bin/plugin --install mobz/elasticsearch-head --timeout 1m

# Wait forever (default)
bin/plugin --install mobz/elasticsearch-head --timeout 0

Proxy settings

edit

To install a plugin via a proxy, you can pass the proxy details using the environment variables proxyHost and proxyPort.

On Linux and Mac, here is an example of setting it:

bin/plugin -DproxyHost=host_name -DproxyPort=port_number --install mobz/elasticsearch-head

On Windows, here is an example of setting it:

set JAVA_OPTS="-DproxyHost=host_name -DproxyPort=port_number"
bin/plugin --install mobz/elasticsearch-head

Lucene version dependent plugins

edit

Added in 1.2.0.

For some plugins, such as analysis plugins, a specific major Lucene version is required to run. In that case, the plugin provides in its es-plugin.properties file the Lucene version for which the plugin was built for.

If present at startup the node will check the Lucene version before loading the plugin.

You can disable that check using plugins.check_lucene: false.

Known Plugins

edit

Analysis Plugins

edit

Supported by the community

Discovery Plugins

edit

Supported by Elasticsearch

Supported by the community

River Plugins

edit

Supported by the community

Transport Plugins

edit

Supported by the community

Scripting Plugins

edit

Site Plugins

edit

Supported by the community

Snapshot/Restore Repository Plugins

edit

Supported by Elasticsearch

Supported by the community

  • GridFS Repository (by Kevin Wang)

Misc Plugins

edit

Supported by Elasticsearch

Supported by the community