5

When performing the setup:upgrade I get this error :

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

I have not enabled It previously, updating from Magento 2.3.5 p1.

3
  • Please make sure, you are using default magento MySQL search. Admin login >> Store >> Configuration >> Catalog >> Catalog search >> Engin it should be Mysql >> Save.
    – Nits
    Jul 30 '20 at 12:51
  • MySql search is removed from M2.4, set Elasticsearch engine from Store >> Configuration >> Catalog >> Catalog search >> Engin
    – Sohel Rana
    Jul 30 '20 at 13:22
  • Thanks, your response was cut off. What value do I set this to if I dont want elastic search.
    – V. Long
    Jul 30 '20 at 16:47
4

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.

You should use ElastiSearch 7, not ElasticSearch 6 as Magento 2.3

First, check if your ElasticSearch in installed and running, you can do via admin panel in the page Stores > Settings > Configuration > Catalog > Catalog > Catalog Search, and click in the test button.

Magento 2.4 ElasticSearch 7

Or using this command below, if required you can change the localhost and port.

curl -XGET 'localhost:9200/my_index/my_type/_search' -d '{
  "query" : {
    "match" : {
      "testField" : "abc"
    }
  }
}'

Via terminal, you can check which search engine you're using today and set it to ElasticSearch 7.

bin/magento config:show catalog/search/engine
bin/magento config:set catalog/search/engine elasticsearch7
0
2

I guess I have just found my anser, according to the following:

"MySQL is no longer used for search. You must use Elasticsearch.

You must install and configure Elasticsearch 7.6.x before upgrading to Magento 2.4.0. New installations require a connection to Elasticsearch to complete."

So I will need to stop and get familiar with elastic search, did I mention I couldnt log in to admin because of 2fa was enabled? And by the way had to learn the command line for installing.

With M1 going away and M2 replacing, it seems there are still major changes that effect the backward compatibility of the product. Im glad I only have M1 production product right now, but trying to get to M2. Seems every release provides new surprises with changes to functionality , prerequisites that takes me days to install and get working.

love it

0

Seem that your elasticsearch hostname is invalid. Try to find this path:

catalog/search/elasticsearch7_server_hostname   

on you core_config_data table and correct it with your host name. For example, if you install your project on local host, set value to:

localhost
-1

Run bin/magento config:show catalog/search/engine if you then get the value mysql change it to Elasticsearch by running bin/magento config:set catalog/search/engine elasticsearch7.

Than you can run the setup:upgrade command again.

2
  • I did run config:show, it came back with no entry. Im upgrading from a 2.3.5 database. Entered command to change to elasticsearch7 and it added. Apparently 2.4 defaults to elastic search because when I run the setup it states the same error. I dont have an elastic server setup. What value goes into this configuration. I did try mysql and of course got the message its not supported. Ive not had experience with elasticsearch, but assume it takes an external server. I dont want to set that up.
    – V. Long
    Jul 30 '20 at 16:37
  • Well in that case the error appear because you do not have Elasticsearch running on your server. Sinds 2.4 Magento no longer support mysql as search engine and it is required to use Elastic. So to upgrade from 2.3.5 you need to install Elasticsearch 7+ to your server.
    – JGeer
    Jul 31 '20 at 6:34

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.