0

I'm trying to install a fresh Magento 2.4 CE on my local PC.

Here are my configurations:

  1. Magento 2.4 CE
  2. Apache 2.4.41 (Ubuntu)
  3. PHP 7.4.8 (cli)
  4. mysql Ver 8.0.21 for Linux on x86_64 (MySQL Community Server - GPL)
  5. Ubuntu 20.04 LTS

I'm trying to install using CLI with this command:

    php bin/magento setup:install 
    --backend-frontname="admin" 
    --key="240d2e12f0f04fdd2dfd2a9bd616b1f6" 
    --session-save="files" 
    --db-host="localhost:9200" 
    --db-name="magento24" 
    --db-user="root" 
    --db-password="admin123" 
    --base-url="http://127.0.0.1/magento24/" 
    --base-url-secure="https://127.0.0.1/magento24/" 
    --admin-user="admin" 
    --admin-password="admin123" 
    --admin-email="admin@admin.com" 
    --admin-firstname="admin" 
    --admin-lastname="khan"

I am getting error Here

In SearchConfig.php line 81:
                                                                           
  Could not validate a connection to Elasticsearch. No alive nodes found in your cluster 

                                                             
           
0

2 Answers 2

1

As per Magento documentation, you must install ElasticSearch first before installing Magento.

Magento Docs

Easiest way to run it in local environment is with Docker. Here's a guide for that: Install ElasticSearch with Docker

1

You must enable ElasticSearch in Magento 2.4, it's a requirement as you can see in the page Magento 2.4 technology stack requirements.

The issue is the ElasticSearch missing in your command.

To start the verification, you can run this curl command below to validate your ElasticSearch, you can change the host elasticsearch to your host.

curl elasticsearch:9200

Install again

Then you can install it again using this command below.

php bin/magento setup:install 
--backend-frontname="admin" 
--key="240d2e12f0f04fdd2dfd2a9bd616b1f6" 
--session-save="files" 
--db-host="localhost:9200" 
--db-name="magento24" 
--db-user="root" 
--db-password="admin123" 
--base-url="http://127.0.0.1/magento24/" 
--base-url-secure="https://127.0.0.1/magento24/" 
--admin-user="admin" 
--admin-password="admin123" 
--admin-email="admin@admin.com" 
--admin-firstname="admin" 
--admin-lastname="khan"
--elasticsearch-host=elasticsearch
5
  • I did the all above and also install elastic search after that I get a new error in xampp i,e "Current version of RDBMS is not supported. Used Version: 10.1.37-MariaDB. Supported versions: MySQL-8, MySQL-5.7, MariaDB-(10.2-10.4)" now I update the MySQL version also and setup button is still not appearing.
    – kantsverma
    Sep 30, 2020 at 7:34
  • In this version, there is no setup button, as you already upgrade the MySQL version, you need to run the command via terminal again. Sep 30, 2020 at 20:12
  • Which command? Setup command I do that but there are showing errors and waring. I solved many like install elastic search then upgrade MySQL version but still showing error in the console.
    – kantsverma
    Oct 4, 2020 at 16:04
  • @kantsverma the command in my answer, which error are you having? Oct 5, 2020 at 18:23
  • For me, adding --elasticsearch-host=elasticsearch --elasticsearch-port=9200 worked for me in dockr
    – Shyam
    Dec 30, 2020 at 17:07

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.