使用自制软件升级Elasticsearch 7.3 [英] Elasticsearch 7.3 upgrade with homebrew

查看:62
本文介绍了使用自制软件升级Elasticsearch 7.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过自制软件使用Elasticsearch 6.8,并且试图升级到7.3.以前,在6.8上,我已经收到有关不存在的日志文件的警告,但是服务器仍可以运行-因此我什么也没做.

I was using Elasticsearch 6.8 via homebrew, and I was trying to upgrade to 7.3. Previously, on 6.8 I already got a warning about a log file that did not exist, but the server would still run - so I did nothing.

现在使用7.3时,出现错误,服务器将无法运行:

Now with 7.3, I get an error and the server won’t run:

Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
output:
[0.002s][error][logging] Error opening log file 'logs/gc.log': No such file or directory
[0.002s][error][logging] Initialization of output 'file=logs/gc.log' using options 'filecount=32,filesize=64m' failed.
error:
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Invalid -Xlog option '-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m', see error log for details.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
    at org.elasticsearch.tools.launchers.JvmErgonomics.flagsFinal(JvmErgonomics.java:111)
    at org.elasticsearch.tools.launchers.JvmErgonomics.finalJvmOptions(JvmErgonomics.java:79)
    at org.elasticsearch.tools.launchers.JvmErgonomics.choose(JvmErgonomics.java:57)
    at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:89)

我尝试创建安装了Elasticsearch的目录/文件,但是对我来说不起作用(或者我做错了什么).

I tried creating the dir/file where elasticsearch was installed, but that did not work for me (or i did something wrong).

推荐答案

参考: https://onecompiler.com/questions/3uwszcf3x/homebrew-installed-elasticsearch-failing-to-start

我已通过将相对日志/gc.log路径更改为绝对路径来解决此问题.请按照以下步骤解决问题

I have fixed this by changing the relative logs/gc.log path to an absolute path. Follow the below steps to solve the issue

  1. 打开位于/usr/local/etc/elasticsearch/jvm.options的jvm.options文件

  1. Open jvm.options file which is located at /usr/local/etc/elasticsearch/jvm.options

将相对路径更改为绝对路径从以下

Change the relative path to an absolute path from the following

# JDK 9+ GC logging
9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m

# JDK 9+ GC logging
9-:-Xlog:gc*,gc+age=trace,safepoint:file=/usr/local/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m

  1. 重新启动elasticsearch $ brew服务重新启动elasticsearch-full 或仅在没有守护程序的情况下启动它- $ elasticsearch
  1. Restart elasticsearch $ brew services restart elasticsearch-full or just start it without daemon - $ elasticsearch

这篇关于使用自制软件升级Elasticsearch 7.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆