Elasticsearch: No alive nodes found in your cluster (fails repeatedly, breaks the inventory index, all products disappear, customers can't place orders!)

ElasticSearch is the cause of the index breaking. So buying a plugin won’t solve cause of the problem it just acts as a sticking plaster. I solved the problem by enabling autostart on ElasticSearch.

ElasticSearch and M2.4
Unlike M2.35, ElasticSearch does more than just search in M2.4 and can’t be disabled because it runs the categories and sends data to Magento as described in the link below. So with ElasticSearch service stopped, the next time the indexing runs (by save or by schedule) it fails…https://magento.stackexchange.com/questions/318745/stopping-elasticsearch-service-removes-category-products-in-2-4

Turn on ElasticSearch AutoRestart on Failure
https://stackoverflow.com/questions/52624720/how-to-auto-restart-elasticsearch-search-once-crashed-on-linux-server (and other places same same thing)

su craig
sudo systemctl edit elasticsearch.service
this creates…
/etc/systemd/system/elasticsearch.service.d/override.conf
sudo nano /etc/systemd/system/elasticsearch.service.d/override.conf
(nano shows /etc/systemd/system/elasticsearch.service.d/.#override.conf20db41b52b20238b - don’t worry this is fine)
add this to the file

[Service]
Restart=always

save (ctrl-X, Y to save changes)
check it has added it at the bottom…
sudo systemctl daemon-reload
sudo systemctl cat elasticsearch.service
sudo systemctl restart elasticsearch
exit (user craig)

2 Likes