I am trying to install Magento 2.4.6 with elastic search, I am using the following

--search-engine elasticsearch8 \ --elasticsearch-port 9232 \ --elasticsearch-index-prefix "test" \

but I just keep getting the error

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

Can anyone see what I am doing wrong?

1 Answer 1


It's a bug in Magento 2.4.6. Could you try the following solutions?

1... Try installing the official magento 2 Elasticsearch 8 Module:

composer require magento/module-elasticsearch-8 --with-all-dependencies

Then, try installing with following parameters:

bin/magento setup:install --disable-modules=Magento_InventoryElasticsearch,Magento_Elasticsearch8,Magento_Elasticsearch,Magento_OpenSearch

After setup is done, enable modules again (Dont enable Magento_OpenSearch again):

bin/magento module:enable Magento_InventoryElasticsearch Magento_Elasticsearch8 Magento_Elasticsearch

Change default search engine to elasticsearch 8:

bin/magento config:set catalog/search/engine 'elasticsearch8'

Start Magento Setup: (ElasticSearch 8 Service should run while starting setup again ;) )

bin/magento setup:upgrade bin/magento setup:di:compile

2... install with --search-engine=elasticsearch7

just tested with elasticsearch 8.6: installed with --search-engine=elasticsearch7 i dont see anything elasticsearch 8 related, when you change in menu to opensearch search engine, magento works ok

Source: Magento Github issue https://github.com/magento/magento2/issues/37236

  • 1
    Perfect, thanks
    – miller75
    Commented Mar 24, 2023 at 9:31
  • 1
    I've been fighting with this for days... thanks for posting the work-around.
    – Jon
    Commented Jul 13, 2023 at 19:50
  • 2
    Tons of Thanks ! works perfectly with my dockergento ``` elasticsearch: tty: true image: elasticsearch:8.8.1 environment: - discovery.type=single-node # may not have an effect - xpack.security.enabled=false - ELASTIC_USERNAME=username - ELASTIC_PASSWORD=password ports: - 9200:9200 networks: - localswarm volumes: - esdata:/usr/share/elasticsearch/data ``` Commented Jul 14, 2023 at 11:24
  • 3
    Additionally I needed to update my ES settings with this indices.id_field_data.enabled: true. Otherwise the products would not show up, although the indexing worked flawlessly.
    – codedge
    Commented Oct 4, 2023 at 12:57
  • 1
    Well, it was required for me even with an local ES setup. Without my shop was empty, even though the indexing went fine.
    – codedge
    Commented Oct 4, 2023 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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