41

I am getting below error while installing Magento 2.4.0 using command line.

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

enter image description here

I have run below two commands.

composer create-project --repository=https://repo.magento.com/ magento/project-community-edition magento240

php -dmemory_limit=-1 bin/magento setup:install 
    --base-url="http://127.0.0.1/magento240" 
    --db-host="localhost" 
    --db-name="magento240" 
    --db-user="root" 
    --db-password="root123" 
    --admin-firstname="admin" 
    --admin-lastname="admin" 
    --admin-email="[email protected]" 
    --admin-user="admin" 
    --admin-password="admin123" 
    --language="en_US" 
    --currency="USD" 
    --timezone="America/Chicago" 
    --use-rewrites="1" 
    --backend-frontname="admin"

Also used below commands.

php -dmemory_limit=-1 bin/magento setup:install 
    --base-url="http://127.0.0.1/magento240" 
    --db-host="localhost" 
    --db-name="magento240" 
    --db-user="root" 
    --db-password="root123" 
    --admin-firstname="admin" 
    --admin-lastname="admin" 
    --admin-email="[email protected]" 
    --admin-user="admin" 
    --admin-password="admin123" 
    --language="en_US" 
    --currency="USD" 
    --timezone="America/Chicago" 
    --use-rewrites="1" 
    --backend-frontname="admin" 
    --search-engine=mysql

php -dmemory_limit=-1 bin/magento setup:install 
    --base-url="http://127.0.0.1/magento240" 
    --db-host="localhost" 
    --db-name="magento240" 
    --db-user="root" 
    --db-password="root123" 
    --admin-firstname="admin" 
    --admin-lastname="admin" 
    --admin-email="[email protected]" 
    --admin-user="admin" 
    --admin-password="admin123" 
    --language="en_US" 
    --currency="USD" 
    --timezone="America/Chicago" 
    --use-rewrites="1" 
    --backend-frontname="admin" 
    --elasticsearch-host=elasticsearch 
    --elasticsearch-username=elastic 
    --elasticsearch-password=changeme
7
  • do you have elasticsearch? with auth enabled?
    – MagenX
    Commented Aug 1, 2020 at 16:47
  • No I have tried to install the latest magento version in my locally linux mint. Commented Aug 2, 2020 at 4:03
  • Have you fix it? Commented Aug 5, 2020 at 10:12
  • By disabling this elastic search module. It's working. Commented Aug 5, 2020 at 11:16
  • Also confirmed after adding 80 port connection becomes successful but while running indexing command getting error. Commented Aug 19, 2020 at 5:30

31 Answers 31

1
2
0

If you import a database from a Magento site whose ElasticSearch is installed on a different server, the setup:upgrade command generates an error in your local environment. To fix it, run the following sql query and compare with another magento 2 site of your local server:

SELECT * FROM core_config_data WHERE path LIKE '%elastic%';

For my case, my local setup was catalog/search/elasticsearch7_server_hostname => localhost and catalog/search/elasticsearch7_server_port => 9200, but the client's database had different settings. So, this error was generated in my environment. After upgrading core_config_data by setting elasticsearch7_server_hostname and elasticsearch7_server_port, my error was fixed.

1
2

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