无法在Ubuntu 16上为Elasticsearch安装x-pack插件

时间:2017-06-07 18:41:39

标签: elasticsearch elasticsearch-plugin

我第一次遇到这个错误:

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)

并使用this workaround将命令打印到控制台并手动运行。

然后我尝试从“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: 

如果我尝试输出“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

1 个答案:

答案 0 :(得分:0)

您使用错误的命令安装x-pack及其命令 ubuntu @ server:/ usr / share / elasticsearch $ sudo bin / elasticsearch-plugin install x-pack

它将自动安装x-pack插件 你可以使用--batch选项,没有运行时promt来允许java clases 和许可。