1

I have installed elasticsearch on local (xampp) and on http://localhost:9200/ is showing it is running. But when I trying to install magento 2.4 getting elasticsearch error.

Magento installation command -

php bin/magento setup:install --base-url="http://127.0.0.1/magento2" --db-host="localhost" --db-name="magento2" --db-user="root" --db-password="" --admin-firstname="Test" --admin-lastname="Test" --admin-email="test@gamil.com" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="INR" --timezone="Asia/Kolkata" --use-rewrites="1" --backend-frontname="admin" --elasticsearch-host=elasticsearch --elasticsearch-port=9200

And getting below error -

Installing search configuration...

In SearchConfig.php line 81:

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

What should I try to install magento 2.4?

2
  • Here is the detailed discussion about Elastic Search. – Vrajesh Patel Feb 26 at 5:26
  • @vinaya what version of elastic search you are using? – Ajmalriyaz Feb 26 at 6:03
1
php bin/magento setup:install --base-url="http://127.0.0.1/magento2" --db-host="localhost" --db-name="magento2" --db-user="root" --db-password="" --admin-firstname="Test" --admin-lastname="Test" --admin-email="test@gamil.com" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="INR" --timezone="Asia/Kolkata" --use-rewrites="1" --backend-frontname="admin" --search-engine=elasticsearch7 --elasticsearch-host=127.0.0.1 --elasticsearch-port=9200
1
  • @VinayaMaheshwari yes, i also saw that you are pointing to the ES engine with the 'elasticsearch' alias, but i am not sure you actually have it configured this way, try @Dipakk's command, or replace 127.0.0.1 with localhost if it doesn't work. – Diana Botean Feb 26 at 9:18
0

First of all you need to install elasticsearch on local machine

For Windows go through below link

https://www.elastic.co/guide/en/elasticsearch/reference/current/zip-windows.html

For Ubuntu got through below link

https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html

Now again run Magento install command

php bin/magento setup:install --base-url="http://127.0.0.1/magento2" --db-host="localhost" --db-name="magento2" --db-user="root" --db-password="" --admin-firstname="Test" --admin-lastname="Test" --admin-email="test@gamil.com" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="INR" --timezone="Asia/Kolkata" --use-rewrites="1" --backend-frontname="admin" --elasticsearch-host=elasticsearch --elasticsearch-port=9200

Now it will works fine for you

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.