gpt4 book ai didi

java - 重启VM后无法启动elasticsearch

转载 作者:行者123 更新时间:2023-12-04 19:06:17 25 4
gpt4 key购买 nike

所以,VM提示它内存不足,我重新启动它,现在我无法启动Elasticsearch
操作系统还列出了它删除了与 java 相关的内容,但我认为它只是一个临时文件(我一般是 linux 和 ubuntu 的新手)。
以下是来自 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.

最佳答案

输出中提到了两个错误:

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


Elasticsearch 进程没有对 /var/log/elasticsearch 的写入权限。文件夹
下面的第二个错误可能来自上面的第一个错误,请确保 gc.log可以写入文件,然后重试。

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

关于java - 重启VM后无法启动elasticsearch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68861292/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com