cancel
Showing results for 
Search instead for 
Did you mean: 

Elasticsearch constantly crashes

Elasticsearch constantly crashes

Hi Folks

 

I'm having a complete nightmare with a new installation of M2.4.1 open source and elasticsearch.

 

I'm not sure I trust the Magento documentation because it all seems to reference 2.3+ and I understand 2.4 implementation is different; it's Elasticsearch or nothing apparently. So is it still relevant I ask myself.

 

I have circa 5,000 products in Magento and 8GB of RAM on the server. Seems the system is killing elasticsearch because it's chewing up all the RAM.

 

Does this seem right?

 

Maybe I just need to allocate more RAM to the cloud server but it's an expensive decision if it doesn't fix it.

 

Any help greatly appreciated - but be gentle, the whole concept of elasticsearch is new to me and I'm finding most of the documentation tells me what to do but not how. I have a million browser tabs open trying to cross-reference...

 

Thanks

Bruce

6 REPLIES 6

Re: Elasticsearch constantly crashes

Hi @bruce_hazelton,

 

Elasticsearch will consume a lot of RAM in your machine and you will have to upgrade your RAM to make it work. 

 

Hope this can help you! Let me know if you need further assistance. 

__________

If issue solved, Click Kudos & Accept as Solution.

LitExtension - #1 Shopping Cart Migration Expert

LitExtension helps store owners and agencies migrate all important data from one eCommerce platform to another accurately, securely and at the highest speed.

Visit website: http://litextension.com/

Re: Elasticsearch constantly crashes

Hi @bruce_hazelton ,

 

I have faced the same problem. I tried this below solution and it works out for me.

In CMD, assign the values of your server and hostname.

 

Try these commands:

php bin/magento config:set catalog/search/elasticsearch7_server_port "port"

php bin/magento config:set catalog/search/elasticsearch7_server_hostname "hostname"

 

Hope this will help you!

Click Kudos and accept as a solution. 

Re: Elasticsearch constantly crashes

@bruce_hazelton First of all, you need to check your current elasticsearch version and upgrade it to 7.x if it's not as 2.4 only supports 7.x.

 

Please refer this guide for other version matches - https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html

Re: Elasticsearch constantly crashes

Did you every find a solution to this?  I am continuing to have this same problem.  I've already installed Magento 2.4.3 on a new AWS EC2 instance with more ram.  It seemed to be running fine for over a week now, and then all of the sudden elasticsearch stopped.  It constantly consumes over 50% of RAM.  

Re: Elasticsearch constantly crashes

I have the same problem. It crashes after the event: Completed deletion of expired ML data.

 

Server configuration:
Ubuntu 20.04.3 LTS
Elasticsearch v 7.15.2
8 GB RAM

Usage Memory: 4.3G

 

After verifying the status, it shows the following status:

Started Elasticsearch.
elasticsearch.service: Main process exited, code=killed, status=9/KILL
elasticsearch.service: Failed with result 'signal'.

Re: Elasticsearch constantly crashes

Please check this solution it helped me 
https://magento.stackexchange.com/a/356200/24595

 

sudo nano /etc/elasticsearch/jvm.options

-Xms4g
-Xmx4g

and change this value according to your RAM, if 16 GB ram then set value half of your ram number

-Xms8g
-Xmx8g


Actually, i create a new config for elastic here 

/etc/elasticsearch/jvm.options.d/heap_size.options

And add there

-Xms8g
-Xmx8g


Hope it will help you