Homebrew: Can't start elastic search

萝らか妹 提交于 2019-12-11 12:09:46

问题


I'm in a big trouble, I can't start Elasticsearch and I need it for run my rails locally, please tell me what's going on. I installed Elasticsearch in the normal fashion then I did the following:

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

But it shows the following error: [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.

I tried several alternative ways of run it, like:

elasticsearch -f -D 

But then I get the following error, and I can't find any useful for solve it, it seems to be related with file perms but not sure:

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.

Thanks for your help.


回答1:


There are some changes with libexec with Elasticsearch/homebrew installation and that is why it is failing to start. There is a PR #45644 currently being worked on. Till the PR gets accepted, you can use the same formula to fix the installation of Elasticsearch.

First uninstall the earlier/older version. Then edit the formula of Elasticsearch:

$ brew edit elasticsearch

And use the formula from the PR.

Then do brew install elasticsearch, it should work fine.

To start Elasticsearch, just do:

$ elasticsearch

config option is no longer valid. For custom config, use path.config:

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


来源:https://stackoverflow.com/questions/33469459/homebrew-cant-start-elastic-search

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!