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

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

enter image description here

I have run below two commands

META_PACKAGE=magento/project-community-edition META_VERSION=2.4.x

 composer create-project --repository-url=https://repo.magento.com/ \
     "${META_PACKAGE}" /tmp/exampleproject "${META_VERSION}"

 rsync -a /tmp/exampleproject/ /var/www/html/
 rm -rf /tmp/exampleproject/

and this

bin/magento setup:install \
     --backend-frontname=backend \
     --amqp-host=rabbitmq \
     --amqp-port=5672 \
     --amqp-user=guest \
     --amqp-password=guest \
     --db-host=db \
     --db-name=magento \
     --db-user=magento \
     --db-password=magento \
     --search-engine=opensearch \
     --opensearch-host=opensearch \
     --opensearch-port=9200 \
     --opensearch-index-prefix=magento2 \
     --opensearch-enable-auth=0 \
     --opensearch-timeout=15 \
     --http-cache-hosts=varnish:80 \
     --session-save=redis \
     --session-save-redis-host=redis \
     --session-save-redis-port=6379 \
     --session-save-redis-db=2 \
     --session-save-redis-max-concurrency=20 \
     --cache-backend=redis \
     --cache-backend-redis-server=redis \
     --cache-backend-redis-db=0 \
     --cache-backend-redis-port=6379 \
     --page-cache=redis \
     --page-cache-redis-server=redis \
     --page-cache-redis-db=1 \

2 Answers 2


Use this one --search-engine= elasticsearch7 instead of this --search-engine=opensearch

I think it will solve your issue


Establish a connection with the elastic search during setup install


 --elasticsearch-host= hostname 

 --elasticsearch-port= port number

 --elasticsearch-index-prefix= magento


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.