自制软件:无法启动弹性搜索

Homebrew: Can't start elastic search

我遇到了大麻烦,我无法启动 Elasticsearch,我需要它用于本地 运行 我的 rails,请告诉我发生了什么。我以正常方式安装了 Elasticsearch,然后执行了以下操作:

elasticsearch --config=/usr/local/opt/elasticsearch/config/elasticsearch.yml

但是显示如下错误:[2015-11-01 20:36:50,574][INFO ][bootstrap] es.config is no longer supported. elasticsearch.yml must be placed in the config directory and cannot be renamed.

我尝试了几种 运行 它的替代方法,例如:

elasticsearch -f -D 

但后来我得到以下错误,我找不到任何有用的解决方法,它似乎与文件权限有关但不确定:

java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap" ClassLoader: sun.misc.Launcher$AppClassLoader@33909752
    at org.joda.time.tz.ZoneInfoProvider.openResource(ZoneInfoProvider.java:210)
    at org.joda.time.tz.ZoneInfoProvider.<init>(ZoneInfoProvider.java:127)
    at org.joda.time.tz.ZoneInfoProvider.<init>(ZoneInfoProvider.java:86)
    at org.joda.time.DateTimeZone.getDefaultProvider(DateTimeZone.java:514)
    at org.joda.time.DateTimeZone.getProvider(DateTimeZone.java:413)
    at org.joda.time.DateTimeZone.forID(DateTimeZone.java:216)
    at org.joda.time.DateTimeZone.getDefault(DateTimeZone.java:151)
    at org.joda.time.chrono.ISOChronology.getInstance(ISOChronology.java:79)
    at org.joda.time.DateTimeUtils.getChronology(DateTimeUtils.java:266)
    at org.joda.time.format.DateTimeFormatter.selectChronology(DateTimeFormatter.java:968)
    at org.joda.time.format.DateTimeFormatter.printTo(DateTimeFormatter.java:672)
    at org.joda.time.format.DateTimeFormatter.printTo(DateTimeFormatter.java:560)
    at org.joda.time.format.DateTimeFormatter.print(DateTimeFormatter.java:644)
    at org.elasticsearch.Build.<clinit>(Build.java:51)
    at org.elasticsearch.node.Node.<init>(Node.java:135)
    at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)
    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:170)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:270)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
[2015-11-01 20:40:57,602][INFO ][node                     ] [Centurius] version[2.0.0], pid[22063], build[de54438/2015-10-22T08:09:48Z]
[2015-11-01 20:40:57,605][INFO ][node                     ] [Centurius] initializing ...
Exception in thread "main" java.lang.IllegalStateException: failed to load bundle [] due to jar hell
Likely root cause: java.security.AccessControlException: access denied ("java.io.FilePermission" "/usr/local/Cellar/elasticsearch/2.0.0/libexec/antlr-runtime-3.5.jar" "read")
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
    at java.security.AccessController.checkPermission(AccessController.java:884)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
    at java.lang.SecurityManager.checkRead(SecurityManager.java:888)
    at java.util.zip.ZipFile.<init>(ZipFile.java:210)
    at java.util.zip.ZipFile.<init>(ZipFile.java:149)
    at java.util.jar.JarFile.<init>(JarFile.java:166)
    at java.util.jar.JarFile.<init>(JarFile.java:103)
    at org.elasticsearch.bootstrap.JarHell.checkJarHell(JarHell.java:173)
    at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:340)
    at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:113)
    at org.elasticsearch.node.Node.<init>(Node.java:144)
    at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)
    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:170)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:270)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.

感谢您的帮助。

libexec 与 Elasticsearch/homebrew 安装有一些变化,这就是它无法启动的原因。目前正在处理一个 PR #45644。在 PR 被接受之前,您可以使用相同的公式来修复 Elasticsearch 的安装。

先卸载earlier/older版本。然后编辑Elasticsearch的公式:

$ brew edit elasticsearch

并使用 PR 中的 formula

然后执行brew install elasticsearch,它应该可以正常工作。

要启动 Elasticsearch,只需执行以下操作:

$ elasticsearch

config 选项不再有效。对于自定义配置,使用 path.config:

$ elasticsearch --path.conf=/usr/local/opt/elasticsearch/config