Hi everyone.
I'm trying to install Elasticsearch 7.12.1 on a server for a customer.
The OS is Ubuntu Server 9.3.0-17 aka 20.04 (the LTS one).
OpenJDK 16 included.
This server is offline so I downloaded the deb package : elasticsearch-7.12.1-amd64.deb
I installed it accoding to the following documentation : Install Elasticsearch with Debian Package | Elasticsearch Guide [7.12] | Elastic
I then copied my version of elasticsearch.yml to /etc/elastic/ folder.
Everything works fine until reaching the "Running with systemd" section.
When I tried to run sudo systemctl start elasticsearch.service
, an error occured.
First, it told me jvm.options was missing.
I found it from the elasticsearch-7.12.1-linux-x86_64.tar.gz archive and copied it with a sudo cp jvm.options /etc/elastic/jvm.options
After that, I had another error :
Jun 22 15:39:31 hbcyslo001 systemd[1]: Starting Elasticsearch...
Jun 22 15:39:34 hbcyslo001 systemd-entrypoint[1977]: Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
Jun 22 15:39:34 hbcyslo001 systemd-entrypoint[1977]: output:
Jun 22 15:39:34 hbcyslo001 systemd-entrypoint[1977]: [0.000s][error][logging] Error opening log file 'logs/gc.log': No such file or directory
Jun 22 15:39:34 hbcyslo001 systemd-entrypoint[1977]: [0.000s][error][logging] Initialization of output 'file=logs/gc.log' using options 'filecount=32,filesize=64m' failed>
Jun 22 15:39:34 hbcyslo001 systemd-entrypoint[1977]: error:
Jun 22 15:39:34 hbcyslo001 systemd-entrypoint[1977]: 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.
Jun 22 15:39:34 hbcyslo001 systemd-entrypoint[1977]: Error: Could not create the Java Virtual Machine.
Jun 22 15:39:34 hbcyslo001 systemd-entrypoint[1977]: Error: A fatal exception has occurred. Program will exit.
Jun 22 15:39:34 hbcyslo001 systemd-entrypoint[1977]: at org.elasticsearch.tools.launchers.JvmOption.flagsFinal(JvmOption.java:119)
Jun 22 15:39:34 hbcyslo001 systemd-entrypoint[1977]: at org.elasticsearch.tools.launchers.JvmOption.findFinalOptions(JvmOption.java:81)
Jun 22 15:39:34 hbcyslo001 systemd-entrypoint[1977]: at org.elasticsearch.tools.launchers.JvmErgonomics.choose(JvmErgonomics.java:38)
Jun 22 15:39:34 hbcyslo001 systemd-entrypoint[1977]: at org.elasticsearch.tools.launchers.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:135)
Jun 22 15:39:34 hbcyslo001 systemd-entrypoint[1977]: at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:86)
Jun 22 15:39:34 hbcyslo001 systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Jun 22 15:39:34 hbcyslo001 systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Jun 22 15:39:34 hbcyslo001 systemd[1]: Failed to start Elasticsearch.
I checked, this gc.log file does not exist.
I tried to perform a chmod 777 on the log folder, without any incidence.
This is kind of urgent for me : This was a test for my customer to show him how powerful the stack is and I'm stuck.
Can anybody help me please ?