Magento 2.4.2-p1

I recently tried to install and run a URL rewrite extension and got Errors regarding ElasticSearch. I've just tried to run the upgrade command after uploading the Magento Porto theme files:

PHP bin/Magento setup:upgrade

It runs and then gives the following Error at the end:

Could not validate a connection to Elasticsearch. No alive nodes found in your cluster

We currently have the following hosting package:

4 x 2.50GHz Cores
160 GB SSD Space
5 TB Bandwidth

My hosting company blames the problem on not enough RAM, therefore ElasticSearch crashing:

The ElasticSearch was down. Which was caused due to lack of memory as per the following Out of Memory errors: Aug 9 17:33:16 node1340 kernel: Out of memory: Killed process 28699 (java) total-vm:4963036kB, anon-rss:1411888kB, file-rss:0kB, shmem-rss:0kB, UID:987 pgtables:3516kB oom_score_adj:0 Aug 9 20:05:50 node1340 kernel: Out of memory: Killed process 15161 (java) total-vm:4945536kB, anon-rss:1370884kB, file-rss:0kB, shmem-rss:0kB, UID:987 pgtables:3336kB oom_score_adj:0 After flushing the cached swap and physical memory, I was able to start your ElasticSearch service.

Your current memory usage is: total used free shared buff/cache available Mem: 7937 4771 1288 470 1877 764 Swap: 511 0 511

Thus you indeed might consider upgrading to a service with more physical memory available to avoid these issues and the service running out of memory.

I checked RAM requirements for Magento 2.4.2-p1 and if I'm looking at this correctly - it says 2 GB of RAM should be fine? (we have 8 GB):


So the big question is - is the hosting company lying to me to get more money out of me or do I really need to upgrade my hosting package and pay lots more each month? If it is not necessary, how can I make sure ElasticSearch stays up and running?

Also, can I just re-run the Magento Porto theme upgrade command once ElasticSearch is running?

php bin/magento setup:upgrade

ElasticSearch 7.9 was the last version of ElasticSearch that would startup up and used 2GB of memory.

After that, versions of ElasticSearch will consume most of the memory on the server without being configuring max heap size. It's a royal pain.

Things to note, you could install ES 7.9 as a quick way to get on board, however, kernel updates to the server will update ES to the latest version.

They also need to configure ES to restart on failure


You have more than enough RAM for this to run. Based on the error, you have a configuration issue with Elasticsearch. Test it by typing curl elasticsearch:9200 into the command line.

If you get an error, Elseticsearch is either not running or it's running on a different port.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.