2

I had downgraded to Elasticsearch 6.X (from 7.x) using Homebrew and started to get a warning.

OpenJDK 64-Bit Server VM warning: Cannot open file logs/gc.log due to No such file or directory

How do you fix it?

I've looked at a similar error on Elasticsearch 8 which gives an error but the answer does not resolve this.

The differences are:

  • different Elasticsearch version 6.X not 7.x
  • warning not an error
  • I am using JDK 8 not 9.
notapatch
  • 6,569
  • 6
  • 41
  • 45

1 Answers1

2

Elasticsearch 6.X

Solution:

#
# /usr/local/etc/elasticsearch/jvm.options
#  - directories might be specific for Homebrew installation
#

## JDK 8 GC logging

...
# Before
8:-Xloggc:logs/gc.log
# After
8:-Xloggc:/usr/local/var/log/elasticsearch/gc.log
...
notapatch
  • 6,569
  • 6
  • 41
  • 45
  • If you are using Java 9+, you need to update this line the same way: ```# JDK 9+ GC logging 9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m``` – SimonH Jun 19 '23 at 11:48