I recently had to use Elasticsearch for a project. For this purpose, I chose the latest version of Elasticsearch, namely 2.3. After uploading a few documents to an index, I wanted to know the health of the server (even though it was installed on my own laptop). For this purpose, I downloaded the latest versions of two plugins, namely head and HQ. While the download portion was easy, I faced a problem while installing the plugins.
As I had downloaded the zip file for the plugin, I wanted to use the same for installation. But, the plugin installer of 2.3 simply refused to accept a path to the local archive. It stubbornly wanted to connect to the Internet and download the plugin before installation. As my laptop is behind a proxy that needs username and password, the plugin download failed. On checking the help provided by the application, I noted that it does not have a ‘url’ option.
As it turns out, this is a drastic departure from the behaviour supported by the plugin application in Elasticsearch 1.7. In that version, the plugin application has an explicit ‘–url’ parameter that can be used to install from a downloaded archive.
As I had been successful in installing the plugins on 1.7, I decide to use that version for my work. When I tried to install the plugins on 1.7, I once again faced a problem, even after specifying a url to the local archive. The syntax I was using was
plugin --install elasticsearch-head --url file://c:/temp/elasticsearch-head-master.zip
After multiple attempts, I looked at a text file that I had created many months ago. I had stored the commands used in this file. On opening the file, I noted that the path to the archive had three ‘/’ after the ‘file’ specification. Once I gave the command using three ‘/’, the installation went smoothly. Thus, the command to use is
plugin --install elasticsearch-head --url file:///c:/temp/elasticsearch-head-master.zip
the install from local folder should work properly. The second important aspect is that you need to provide the full path to the archive. Using a relative path does not work.