elasticsearch,upgrade,Macos,elasticsearch,Upgrade" /> elasticsearch,upgrade,Macos,elasticsearch,Upgrade" />

Macos Elasticsearch无法在OSX上启动或运行

Macos Elasticsearch无法在OSX上启动或运行,macos,elasticsearch,upgrade,Macos,elasticsearch,Upgrade,我发帖希望能帮助其他人,如果他们在Mac上遇到这个问题。我最近使用自制软件将ES更新为2.2.x分支: brew uninstall --force elasticsearch brew update brew install elasticsearch 在端口9200上尝试localhost和127.0.0.1时,我反复遇到连接错误 curl http://localhost:9200 curl: (7) Failed to connect to localhost port 9200: C

我发帖希望能帮助其他人,如果他们在Mac上遇到这个问题。我最近使用自制软件将ES更新为2.2.x分支:

brew uninstall --force elasticsearch
brew update
brew install elasticsearch
在端口9200上尝试localhost和127.0.0.1时,我反复遇到连接错误

curl http://localhost:9200
curl: (7) Failed to connect to localhost port 9200: Connection refused
我试着卸载和装载

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
然后尝试手动启动

elasticsearch
出现了以下错误,表明Java版本1.7.x是一个错误,以及它无法启动的原因

Exception in thread "main" java.lang.RuntimeException: Java version: Oracle Corporation 1.7.0_45 [Java HotSpot(TM) 64-Bit Server VM 24.45-b08] suffers from critical bug https://bugs.openjdk.java.net/browse/JDK-8024830 which can cause data corruption.
Please upgrade the JVM, see http://www.elastic.co/guide/en/elasticsearch/reference/current/_installation.html for current recommendations.
If you absolutely cannot upgrade, please add -XX:-UseSuperWord to the JAVA_OPTS environment variable.
Upgrading is preferred, this workaround will result in degraded performance.
    at org.elasticsearch.bootstrap.JVMCheck.check(JVMCheck.java:123)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:283)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.
在克服这个错误之后,1.7.x分支上以前安装的插件也出现了错误

Exception in thread "main" java.lang.IllegalStateException: Could not load plugin descriptor for existing plugin [bigdesk]. Was the plugin built before 2.0?
Likely root cause: java.nio.file.NoSuchFileException: /usr/local/var/lib/elasticsearch/plugins/bigdesk/plugin-descriptor.properties
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
    at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
    at java.nio.file.Files.newByteChannel(Files.java:315)
    at java.nio.file.Files.newByteChannel(Files.java:361)
    at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:380)
    at java.nio.file.Files.newInputStream(Files.java:106)
    at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:87)
    at org.elasticsearch.plugins.PluginsService.getPluginBundles(PluginsService.java:378)
    at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:128)
    at org.elasticsearch.node.Node.<init>(Node.java:146)
    at org.elasticsearch.node.Node.<init>(Node.java:128)
    at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)
    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.
线程“main”java.lang.IllegalStateException中的异常:无法为现有插件[bigdesk]加载插件描述符。这个插件是在2.0之前构建的吗? 可能的根本原因:java.nio.file.NoSuchFileException:/usr/local/var/lib/elasticsearch/plugins/bigdesk/plugin-descriptor.properties 位于sun.nio.fs.UnixException.translateToIOException(UnixException.java:86) 位于sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) 位于sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) 位于sun.nio.fs.UnixFileSystemProvider.newbytechnel(UnixFileSystemProvider.java:214) 位于java.nio.file.Files.newByteChannel(Files.java:315) 位于java.nio.file.Files.newByteChannel(Files.java:361) 位于java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:380) 位于java.nio.file.Files.newInputStream(Files.java:106) 位于org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:87) 在org.elasticsearch.plugins.PluginsService.getPluginBundles(PluginsService.java:378) 在org.elasticsearch.plugins.PluginsService.(PluginsService.java:128) 在org.elasticsearch.node.node.(node.java:146) 在org.elasticsearch.node.node.(node.java:128) 位于org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145) 位于org.elasticsearch.bootstrap.bootstrap.setup(bootstrap.java:178) 位于org.elasticsearch.bootstrap.bootstrap.init(bootstrap.java:285) 位于org.elasticsearch.bootstrap.elasticsearch.main(elasticsearch.java:35) 有关完整的错误详细信息,请参阅日志。
我发现这些问题的解决方案如下:

  • 编辑
    /usr/local/etc/elasticsearch/elasticsearch.yml
    文件,并验证
    bind\u主机
    配置已注释,因此它将默认为0.0.0.0

  • 编辑
    /usr/local/Cellar/elasticsearch/YOUR_VERSION/libexec/bin/elasticsearch.in.sh
    文件,并在另一个
    JAVA_选项之后添加
    -XX:-UserSuperWord
    标志:

    JAVA_OPTS=“$JAVA_OPTS-XX:-UseSuperWord”

  • 手动删除以前的插件,以便为该ES分支安装最新版本:

    /usr/local/ceral/elasticsearch/2.2.0\u 1/libexec/bin/plugin list

    安装在/usr/local/var/lib/elasticsearch/plugins:

    - bigdesk
    - head
    
    /usr/local/ceral/elasticsearch/2.2.0_1/libexec/bin/plugin remove bigdesk
    /usr/local/ceral/elasticsearch/2.2.0_1/libexec/bin/plugin remove head



  • 在这些步骤之后,我可以再次启动ES2.x,然后我可以重新安装任何需要的插件。如果其他人遇到类似问题,我希望这能帮助他们。

    我在MacOs上遇到过这个问题,当时我试图卸载elasticsearch7并安装elastisearch@6使用自制软件。 我通过手动删除以下目录并安装elasticsearch@6

    Data:    /usr/local/var/lib/elasticsearch/
    Logs:    /usr/local/var/log/elasticsearch/elasticsearch_<<user>>.log
    Plugins: /usr/local/var/elasticsearch/plugins/
    Config:  /usr/local/etc/elasticsearch/
    
    Data:/usr/local/var/lib/elasticsearch/
    日志:/usr/local/var/log/elasticsearch/elasticsearch.log
    插件:/usr/local/var/elasticsearch/Plugins/
    配置:/usr/local/etc/elasticsearch/
    
    步骤:

    >brew uninstall elasticsearch
    >rm -rf <<above mentioned directories>>
    >brew install elasticsearch@6
    
    >brew卸载elasticsearch
    >rm-rf
    >brew安装elasticsearch@6
    
    编辑长度必须为六个字符,但我只想指出您键入的是
    -XX:-UserSuperWord
    ,而不是
    -XX:-UseSuperWord
    。谢谢你的回答,它帮助我让ES重新工作。