Not able to start elasticsearch post customization to modify default paths

I am getting below error message while starting elasticsearch post configuration path modification.

Jun 27 08:29:46 ip-.eu-central-1.compute.internal systemd[1]: elasticsearch.service: Main process exited, code=exited, status=70/SOFTWARE
Jun 27 08:29:46 ip-.eu-central-1.compute.internal systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Jun 27 08:29:46 ip-.eu-central-1.compute.internal systemd[1]: Failed to start Elasticsearch.

What dies

journalctl -u elasticsearch

say

Thanks Rain for the suggestion, below is the output for your suggested command.

Note:- removed IP address in this error message from safety perspective.

Jun 27 08:12:47 ip-.eu-central-1.compute.internal systemd[1]: Starting Elasticsearch...
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd-entrypoint[2685]: java.lang.RuntimeException: starting java failed with [1]
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd-entrypoint[2685]: output:
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd-entrypoint[2685]: [0.000s][error][logging] Error opening log file '/var/log/elasticsear>
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd-entrypoint[2685]: [0.000s][error][logging] Initialization of output 'file=/var/log/elas>
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd-entrypoint[2685]: error:
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd-entrypoint[2685]: Invalid -Xlog option '-Xlog:gc*,gc+age=trace,safepoint:file=/var/log/>
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd-entrypoint[2685]: Error: Could not create the Java Virtual Machine.
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd-entrypoint[2685]: Error: A fatal exception has occurred. Program will exit.
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd-entrypoint[2685]: at org.elasticsearch.server.cli.JvmOption.flagsFinal(JvmOptio>
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd-entrypoint[2685]: at org.elasticsearch.server.cli.JvmOption.findFinalOptions(Jv>
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd-entrypoint[2685]: at org.elasticsearch.server.cli.MachineDependentHeap.determin>
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd-entrypoint[2685]: at org.elasticsearch.server.cli.JvmOptionsParser.jvmOptions(J>
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd-entrypoint[2685]: at org.elasticsearch.server.cli.JvmOptionsParser.determineJvm>
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd-entrypoint[2685]: at org.elasticsearch.server.cli.ServerCli.startServer(ServerC>
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd-entrypoint[2685]: at org.elasticsearch.server.cli.ServerCli.execute(ServerCli.j>
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd-entrypoint[2685]: at org.elasticsearch.common.cli.EnvironmentAwareCommand.execu>
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd-entrypoint[2685]: at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Com>
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd-entrypoint[2685]: at org.elasticsearch.cli.Command.main(Command.java:54)
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd-entrypoint[2685]: at org.elasticsearch.launcher.CliToolLauncher.main(CliToolLau>
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd[1]: elasticsearch.service: Main process exited, code=exited, status=70/SOFTWARE
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Jun 27 08:12:48 ip-.eu-central-1.compute.internal systemd[1]: Failed to start Elasticsearch.

Looks like a problem? Did you change this from the default ? Permissions ?

I’m not sure if journalctl output is getting cut somehow, pipe to cat and check. Sometimes it decides your terminal is only N chars wide and chomps the rest of the lines.

Now, you can see full details .

However, as per today experience, elasticsearch didn't come up post modification of /var/log/elasticsearch path to desired location.

cat journalctl.output_30062025.txt

-- Logs begin at Mon 2025-06-30 06:48:57 UTC, end at Mon 2025-06-30 09:55:27 UTC. --
Jun 30 06:49:04 ip-.eu-central-1.compute.internal systemd[1]: Starting Elasticsearch...
Jun 30 06:49:29 ip-.eu-central-1.compute.internal systemd[1]: Started Elasticsearch.
Jun 30 09:48:42 ip-.eu-central-1.compute.internal systemd[1]: Stopping Elasticsearch...
Jun 30 09:48:43 ip-.eu-central-1.compute.internal systemd[1]: elasticsearch.service: Succeeded.
Jun 30 09:48:43 ip-.eu-central-1.compute.internal systemd[1]: Stopped Elasticsearch.
Jun 30 09:54:06 ip-.eu-central-1.compute.internal systemd[1]: Starting Elasticsearch...
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: java.lang.RuntimeException: starting java failed with [1]
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: output:
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: [0.000s][error][logging] Error opening log file '/var/log/elasticsearch/vfdest.log': No such file or directory
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: [0.000s][error][logging] Initialization of output 'file=/var/log/elasticsearch/vfdest.log' using options 'filecount=32,filesize=64m' failed.
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: error:
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: Invalid -Xlog option '-Xlog:gc*,gc+age=trace,safepoint:file=/var/log/elasticsearch/vfdest.log:utctime,level,pid,tags:filecount=32,filesize=64m', see error log for details.
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: Error: Could not create the Java Virtual Machine.
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: Error: A fatal exception has occurred. Program will exit.
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: at org.elasticsearch.server.cli.JvmOption.flagsFinal(JvmOption.java:121)
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: at org.elasticsearch.server.cli.JvmOption.findFinalOptions(JvmOption.java:88)
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: at org.elasticsearch.server.cli.MachineDependentHeap.determineHeapSettings(MachineDependentHeap.java:56)
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: at org.elasticsearch.server.cli.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:146)
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: at org.elasticsearch.server.cli.JvmOptionsParser.determineJvmOptions(JvmOptionsParser.java:98)
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: at org.elasticsearch.server.cli.ServerCli.startServer(ServerCli.java:268)
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: at org.elasticsearch.server.cli.ServerCli.execute(ServerCli.java:111)
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: at org.elasticsearch.common.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:55)
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:101)
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: at org.elasticsearch.cli.Command.main(Command.java:54)
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: at org.elasticsearch.launcher.CliToolLauncher.main(CliToolLauncher.java:65)
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd[1]: elasticsearch.service: Main process exited, code=exited, status=70/SOFTWARE
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd[1]: Failed to start Elasticsearch.

Hello @venkat_tammi

As per the error message shared , could be issue with jvm.options files. you should share the elasticsearch.yml , jvm.options file so that anyone will be able to guide you further.

Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: error:
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: Invalid -Xlog option '-Xlog:gc*,gc+age=trace,safepoint:file=/var/log/elasticsearch/vfdest.log:utctime,level,pid,tags:filecount=32,filesize=64m', see error log for details.
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: **Error: Could not create the Java Virtual Machine.**
Jun 30 09:54:07 ip-.eu-central-1.compute.internal systemd-entrypoint[2727]: Error: A fatal exception has occurred. Program will exit.

Thanks!!

Thank you Rain and Tortoise for your valuable inputs. Finally, this issue got conclusion after modifying jvm.options and log4j2.properties files to write the logs at desired location.

1 Like