1

I just upgraded magento 2.3.5 to 2.4.1 . Its completed successfully and i did changed search engine form "mysql" to "elasticsearch" and now its showing error when i run : bin/magento setup:upgrade

Your current search engine, 'Elasticsearch 2', is not supported. You must install a supported search engine before upgrading. See the System Upgrade Guide for more information.

I have installed and configured elasticsearch like below :

{
  "name" : "test-pc",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "ixBumh5mSbSdZkxTFZNErg",
  "version" : {
    "number" : "7.10.1",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "1c34507e66d7db1211f66f3513706fdf548736aa",
    "build_date" : "2020-12-05T01:00:33.671820Z",
    "build_snapshot" : false,
    "lucene_version" : "8.7.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Anybody have any idea whats going wrong here ?

5

From the error message, it seems to me that ES2 is configured to be used instead of ES7. You can validate this by running the following command:

php bin/magento config:show catalog/search/engine

If the result is anything but 'elasticsearch7', then it's not ok and you need to properly set it. You can setup the engine from admin as well as the CLI. If you need to set from CLI, you can use the following commands:

php bin/magento config:set catalog/search/engine elasticsearch7
php bin/magento config:set catalog/search/elasticsearch7_server_hostname <elasticsearch_hostname>
php bin/magento config:set catalog/search/elasticsearch7_server_port <elasticsearch_port>

just make sure you replace the hostname and port placeholders with the actual Elasticsearch connection data.

Afterwards, as previously mentioned by Petar, you can check the connection from the Admin panel.

0
2

You can try this

sudo apt update
service elasticsearch start
sudo apt install elasticsearch
sudo systemctl start elasticsearch
sudo systemctl enable elasticsearch
3
  • Not working for me – Mukesh Prajapati Jan 8 at 7:11
  • 3
    Did you check in the admin panel if you have set your elasticsearch7 instance as default? If so there is a test connection button which shows you if you are connected to elastic search – Petar Borisovski Jan 8 at 8:40
  • 1
    @PetarBorisovski this is the correct answer. Thank you so much its resolved my issue . Thanks again!!! – Mukesh Prajapati Feb 2 at 8:12

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.