Unable to install x-pack plugin on Ubuntu 16

I was able to install x-pack inside Kibana just fine. But for ElasticSearch, I first got this error:

ubuntu@server:/usr/share/elasticsearch$ sudo bin/plugin install x-pack
Exception in thread "main" org.elasticsearch.env.FailedToResolveConfigException: Failed to resolve config path ["/usr/share/elasticsearch/config/elasticsearch.yml"], tried file path ["/usr/share/elasticsearch/config/elasticsearch.yml"], path file ["/usr/share/elasticsearch/config"/"/usr/share/elasticsearch/config/elasticsearch.yml"], and classpath
	at org.elasticsearch.env.Environment.resolveConfig(Environment.java:291)
	at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareSettings(InternalSettingsPreparer.java:95)
	at org.elasticsearch.plugins.PluginManager.main(PluginManager.java:396)

and used this workaround to print the command to the console and run it manually.

Then I tried to run the command output from "sudo bin/plugin install file:///home/ubuntu/x-pack-5.4.1.zip":

/usr/share/elasticsearch$ sudo /usr/lib/jvm/java-8-oracle/jre/bin/java -Xmx64m -Xms16m -Delasticsearch -Des.path.home="/usr/share/elasticsearch" -Des.default.path.conf="/usr/share/elasticsearch/config" -Des.default.config="/usr/share/elasticsearch/config/elasticsearch.yml" -cp ":/usr/share/java/lucene-facet-4.10.4.jar:/usr/share/java/lucene-memory-4.10.4.jar:/usr/share/java/lucene-queries-4.10.4.jar:/usr/share/java/jts.jar:/usr/share/java/lucene-core-4.10.4.jar:/usr/share/java/lucene-sandbox-4.10.4.jar:/usr/share/java/lucene-analyzers-smartcn-4.10.4.jar:/usr/share/java/lucene-analyzers-morfologik-4.10.4.jar:/usr/share/java/lucene-highlighter-4.10.4.jar:/usr/share/java/lucene-codecs-4.10.4.jar:/usr/share/java/elasticsearch-1.7.3.jar:/usr/share/java/lucene-benchmark-4.10.4.jar:/usr/share/java/lucene-misc-4.10.4.jar:/usr/share/java/lucene-grouping-4.10.4.jar:/usr/share/java/lucene-demo-4.10.4.jar:/usr/share/java/lucene-analyzers-phonetic-4.10.4.jar:/usr/share/java/lucene-analyzers-stempel-4.10.4.jar:/usr/share/java/lucene-analyzers-common-4.10.4.jar:/usr/share/java/groovy-all-2.x.jar:/usr/share/java/spatial4j-0.4.1.jar:/usr/share/java/lucene-expressions-4.10.4.jar:/usr/share/java/lucene-queryparser-4.10.4.jar:/usr/share/java/lucene-classification-4.10.4.jar:/usr/share/java/lucene-analyzers-kuromoji-4.10.4.jar:/usr/share/java/lucene-analyzers-uima-4.10.4.jar:/usr/share/java/sigar.jar:/usr/share/java/log4j-1.2-1.2.17.jar:/usr/share/java/apache-log4j-extras-1.2.17.jar:/usr/share/java/lucene-join-4.10.4.jar:/usr/share/java/lucene-test-framework-4.10.4.jar:/usr/share/java/lucene-suggest-4.10.4.jar:/usr/share/java/lucene-analyzers-icu-4.10.4.jar:/usr/share/java/lucene-replicator-4.10.4.jar:/usr/share/java/lucene-spatial-4.10.4.jar:/usr/share/java/jna.jar:" org.elasticsearch.plugins.PluginManager "install" "file:///home/ubuntu/x-pack-5.4.1.zip"
-> Installing file:///home/ubuntu/x-pack-5.4.1.zip...
Usage:
    -u, --url     [plugin location]   : Set exact URL to download the plugin from
    -i, --install [plugin name]       : Downloads and installs listed plugins [*]
    -t, --timeout [duration]          : Timeout setting: 30s, 1m, 1h... (infinite by default)
    -r, --remove  [plugin name]       : Removes listed plugins
    -l, --list                        : List installed plugins
    -v, --verbose                     : Prints verbose messages
    -s, --silent                      : Run in silent mode
    -h, --help                        : Prints this help message

 [*] Plugin name could be:
     elasticsearch/plugin/version for official elasticsearch plugins (download from download.elasticsearch.org)
     groupId/artifactId/version   for community plugins (download from maven central or oss sonatype)
     username/repository          for site plugins (download from github master)

Message:
   Error while installing plugin, reason: ElasticsearchIllegalArgumentException: Illegal plugin name: 

I get this error if I try the output of "sudo bin/plugin install x-pack":

-> Installing x-pack...
Trying https://github.com/null/x-pack/archive/master.zip...
Failed to install x-pack, reason: failed to download out of all 
possible locations..., use --verbose to get detailed information

It looks like you have a very old version of Elasticsearch.

From the version of Lucene you have, my guess is that you're running Elasticsearch 1.x

X-Pack is only available for Elasticsearch 5 and newer.

Try running

bin/elasticsearch-plugin install x-pack

https://www.elastic.co/guide/en/x-pack/current/installing-xpack.html

Hi Tim,

Thanks for your note.
I installed the latest version of elasticsearch from the website, so I don't think it's version 1.x.

Should I just try the docker container here to get up and running quickly?

thanks,
imran

Hey Eddie,

I don't have the elasticsearch-plugin program - I just have 'plugin' in my elasticsearch/bin folder.
Am I not running the right version?

thanks

@skunkwerk

Tim is correct. It looks like you're running Elasticsearch 1.x. It looks like during the 1.x days there was a shell script called plugin and in the 5.x days there is shell script called elasticsearch-plugin. See the screenshot below which shows a directory listing of the elasticsearch bin directory for 1.7.3 and 5.4.1. That should explain why you do not have elasticsearch-plugin.

That's a reasonable option, but I'd recommend that you use the official docker image:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.