Haitham Ismaill
Haitham Ismaill

Reputation: 65

Can't start elasticsearch after restarting VM

So, the VM prompted that it is low on memory, I restarted it and now I can't start Elasticsearch the OS also listed that it deleted something related to java but I assumed it is just a temporary file (I am new to linux and ubuntu in general).

Here is the info from journal-xe:

haitham@haithamserver:~$ journalctl -xe
Aug 20 10:38:09 haithamserver systemd[1]: Started Session 3 of user haitham.
-- Subject: A start job for unit session-3.scope has finished successfully
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit session-3.scope has finished successfully.
--
-- The job identifier is 520.
Aug 20 10:38:09 haithamserver systemd-logind[637]: New session 3 of user haitham.
-- Subject: A new session 3 has been created for user haitham
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
--
-- A new session with the ID 3 has been created for the user haitham.
--
-- The leading process of the session is 1233.
Aug 20 10:38:25 haithamserver sudo[1326]: pam_unix(sudo:auth): Couldn't open /etc/securetty: No such file or directory
Aug 20 10:38:28 haithamserver sudo[1326]: pam_unix(sudo:auth): Couldn't open /etc/securetty: No such file or directory
Aug 20 10:38:28 haithamserver sudo[1326]:  haitham : TTY=pts/0 ; PWD=/home/haitham ; USER=root ; COMMAND=/usr/bin/systemctl start elasticsearch
Aug 20 10:38:28 haithamserver sudo[1326]: pam_unix(sudo:session): session opened for user root by haitham(uid=0)
Aug 20 10:38:28 haithamserver systemd[1]: Starting Elasticsearch...
-- Subject: A start job for unit elasticsearch.service has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit elasticsearch.service has begun execution.
--
-- The job identifier is 602.
Aug 20 10:38:30 haithamserver systemd-entrypoint[1452]: Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
Aug 20 10:38:30 haithamserver systemd-entrypoint[1452]: output:
Aug 20 10:38:30 haithamserver systemd-entrypoint[1452]: [0.000s][error][logging] Error opening log file '/var/log/elasticsearch/gc.log': Permission denied
Aug 20 10:38:30 haithamserver systemd-entrypoint[1452]: [0.000s][error][logging] Initialization of output 'file=/var/log/elasticsearch/gc.log' using options 'filecount=32,filesize=64m' failed.
Aug 20 10:38:30 haithamserver systemd-entrypoint[1452]: error:
Aug 20 10:38:30 haithamserver systemd-entrypoint[1452]: Invalid -Xlog option '-Xlog:gc*,gc+age=trace,safepoint:file=/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m', see error log for details.
Aug 20 10:38:30 haithamserver systemd-entrypoint[1452]: Error: Could not create the Java Virtual Machine.
Aug 20 10:38:30 haithamserver systemd-entrypoint[1452]: Error: A fatal exception has occurred. Program will exit.
Aug 20 10:38:30 haithamserver systemd-entrypoint[1452]:         at org.elasticsearch.tools.launchers.JvmOption.flagsFinal(JvmOption.java:119)
Aug 20 10:38:30 haithamserver systemd-entrypoint[1452]:         at org.elasticsearch.tools.launchers.JvmOption.findFinalOptions(JvmOption.java:81)
Aug 20 10:38:30 haithamserver systemd-entrypoint[1452]:         at org.elasticsearch.tools.launchers.JvmErgonomics.choose(JvmErgonomics.java:38)
Aug 20 10:38:30 haithamserver systemd-entrypoint[1452]:         at org.elasticsearch.tools.launchers.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:135)
Aug 20 10:38:30 haithamserver systemd-entrypoint[1452]:         at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:86)
Aug 20 10:38:30 haithamserver systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- An ExecStart= process belonging to unit elasticsearch.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Aug 20 10:38:30 haithamserver sudo[1326]: pam_unix(sudo:session): session closed for user root
Aug 20 10:38:30 haithamserver systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit elasticsearch.service has entered the 'failed' state with result 'exit-code'.
Aug 20 10:38:30 haithamserver systemd[1]: Failed to start Elasticsearch.
-- Subject: A start job for unit elasticsearch.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit elasticsearch.service has finished with a failure.
--
-- The job identifier is 602 and the job result is failed.

Upvotes: 0

Views: 611

Answers (1)

Val
Val

Reputation: 217424

There are two errors mentioned in the output:

Error opening log file '/var/log/elasticsearch/gc.log': Permission denied

The Elasticsearch process doesn't have write access to the /var/log/elasticsearch folder

The second error below probably derives from the first one above, make sure that the gc.log file can be written and then try again.

Invalid -Xlog option '-Xlog:gc*,gc+age=trace,safepoint:file=/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m'

Upvotes: 2

Related Questions