I've struggled with trying to configure a customized path for the plugins in Elasticsearch 2.2.0, on a fresh Windows Server 2012 R2 host.
Summary
Although I specify path.plugins
, and Elasticsearch confirms this configuration, the plugin
installer still tries to install the plugins in the default location. My conclusion is that the plugin
installer ignores the path.plugins
setting.
To work around this I had to specify the -Des.path.plugins="<my plugin path>"
to all plugin
commands.
When testing, I executed the commands from a non-Administrator command window, as a Windows user without permission to write into the default plugin location. This to ensure nothing was installed in another location than the one I wanted.
If I granted the plugin
installer access to the default plugins location, the installation worked. However, Elasticsearch could not access the plugin, as it was looking in the location specified by path.plugins
.
Configuring a custom path for plugins
In elasticsearch.yml
, I've configured path.plugins: c:\ES_1\plugins
and restarted my Elasticsearch instance. When querying with /_nodes/?pretty
I get:
"settings" : {
"path" : {
"plugins" : "c:\ES_1\plugins",
"home" : "C:\Program Files\Elastic\elasticsearch-2.2.0"
},
}
So, Elasticsearch confirms the new location for the plugins. And the folder exists (created by Elasticsearch). So far, so good.
Example 1: Trying to install a plugin (without specifying the path)
C:\Program Files\Elastic\elasticsearch-2.2.0\bin>plugin install mobz/elasticsearch-head
-> Installing mobz/elasticsearch-head...
Plugins directory [C:\Program Files\Elastic\elasticsearch-2.2.0\plugins] does not exist. Creating...
ERROR: C:\Program Files\Elastic\elasticsearch-2.2.0\plugins
Obviously, it tries to install in the default location.
Example 2: Installing head by specifying the path
C:\Program Files\Elastic\elasticsearch-2.2.0\bin>plugin -Des.path.plugins="C:\ES_1\plugins" install mobz/elasticsearch-head
-> Installing mobz/elasticsearch-head...
Trying https://github.com/mobz/elasticsearch-head/archive/master.zip ...
Downloading ............................................................................................................
.........................................................................DONE
Verifying https://github.com/mobz/elasticsearch-head/archive/master.zip checksums if available ...
NOTE: Unable to verify checksum for downloaded plugin (unable to find .sha1 or .md5 file to verify)
Installed head into C:\ES_1\plugins\head
So, if I specify the path, the installation works fine. I also confirmed that Elasticsearch could access it by launching "head" in a browser.
Example 3: List installed plugins, without specifying the path
An execution without specifying the path returns no plugins, although head is installed:
C:\Program Files\Elastic\elasticsearch-2.2.0\bin>plugin list
Installed plugins in C:\Program Files\Elastic\elasticsearch-2.2.0\plugins:
No plugin detected
Example 4: List all installed plugins, by specifying the path
But when I provide the path to where I installed the head plugin, it is listed:
C:\Program Files\Elastic\elasticsearch-2.2.0\bin>plugin -Des.path.plugins="C:\ES_1\plugins" list
Installed plugins in C:\ES_1\plugins:
- head
Example 5: Remove the head plugin
To uninstall the head plugin, I must also provide the path:
C:\Program Files\Elastic\elasticsearch-2.2.0\bin>plugin -Des.path.plugins="C:\ES_1\plugins" remove head
-> Removing head...
Removed head