在Ubuntu上运行Magento项目的Elasticsearch出现问题



我正在尝试设置Elasticsearch用于Magento 2.4.2项目。我已经安装了Elasticsearch 7.9.3和openjdk 11.0.10。我得到了错误:

sudo systemctl start elasticsearch:

*Job for elasticsearch.service failed because the control process exited with error code.
See "systemctl status elasticsearch.service" and "journalctl -xe" for details.*
In the /etc/elasticsearch/elasticsearch.yml network settings are:
**network.host:** 127.0.0.1
**http.port:** 9200

journalctl xe命令结果:

-- 
-- An ExecStart= process belonging to unit elasticsearch.service has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 1.
Mar 10 16:10:46 -ThinkPad-P15s-Gen-1 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'.
Mar 10 16:10:46 -ThinkPad-P15s-Gen-1 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 10277 and the job result is failed.
Mar 10 16:10:46 -ThinkPad-P15s-Gen-1 sudo[21081]: pam_unix(sudo:session): session closed for user root
Mar 10 16:15:06 -ThinkPad-P15s-Gen-1 sudo[21568]:  : TTY=pts/0 ; PWD=/home/; USER=root ; COMMAND=/usr/bin/nano /etc/elasticsearch/>
Mar 10 16:15:06 -ThinkPad-P15s-Gen-1 sudo[21568]: pam_unix(sudo:session): session opened for user root by (uid=0)
Mar 10 16:15:25 -ThinkPad-P15s-Gen-1 sudo[21568]: pam_unix(sudo:session): session closed for user root
Mar 10 16:15:52 -ThinkPad-P15s-Gen-1 wpa_supplicant[853]: wlp0s20f3: WPA: Group rekeying completed with ac:cf:85:db:37:ce [GTK=CCMP]

看了所有的文章,但没有一篇有助于解决这个问题。Сan有人提出一个解决这个问题的主意吗?

您共享的错误数据只是将错误标识为'退出'。这让我想到了猜测工作来帮助你解决这个问题。

从Elasticsearch。在yaml配置中,Elasticsearch公开其API的端口是9200。一种可能是该端口可能被预先占用。你能不能看看你系统上的端口状态并确认一下。

Elasticsearch。service文件中有内存和CPU的配置。可能是配置的内存不足以启动。

希望这对你有帮助。关于如何安装Magento 2.4.2的详细和直接的说明,我写的这个博客可能会对你有所帮助。

最新更新