简体   繁体   中英

Problem running Elasticsearch for Magento project on Ubuntu

I'm trying set up Elasticsearch for Magento 2.4.2 project. I have installed Elasticsearch 7.9.3 and openjdk 11.0.10. I got the error:

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 command result:

-- 
-- 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]

Looked through all the articles, but none of them helps to fix the situation. Сan someone suggest an idea for a solution to this problem?

The error data you shared is just identifying the error as 'exited'. This brings me to the guess work to help you with the issue.

From the Elasticsearch.yaml configuration, the port on which the Elasticsearch exposes its API is on 9200. One possibility is that the port might be pre-occupied. Can you look at the port status on your system and confirm it.

Elasticsearch.service file has configurations for memory and CPU. May be the configured memory is not sufficient for it to start.

Hope this helps. For detailed and straight forward instructions on how to install the Magento 2.4.2 this blog written by me might help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM