Hi, I'm having the same problem you reported on GitHub in the Magento 2.4 installation
In SearchConfig.php line 81:
Could not validate a connection to Elasticsearch. No alive nodes found in y
our cluster
I've got elasticserarch running locally, I've got kibana, brain and enterprise-search hooked up and they're all communicating smoothly and reporting a green health status.
My version of elastic search is 7.8.1
at elasticsearch.yml I now have these rules active
cluster.name: ga+++++r
xpack.security.enabled: true
xpack.security.authc.api_key.enabled: true
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: localhost
network.publish_host: 127.0.0.1
network.bind_host: 127.0.0.1
http.port: 9200
transport.tcp.port: 9300
discovery.type: single-node
My installation command is:
bin/magento setup:install \
--base-url=https://++++++++.de \
--db-host=localhost \
--db-name=G+++++++bd \
--db-user=G++++++++++0 \
--db-password=@+++++++++++@ \
--admin-firstname=J++++n \
--admin-lastname=W++++r \
--admin-email=jw++++++++++ail.com \
--admin-user=j++++++++s \
--admin-password=B+++++++++k \
--language=en_US \
--currency=USD \
--timezone=America/Chicago \
--use-rewrites=1 \
--search-engine=elasticsearch7 \
--elasticsearch-host=https://127.0.0.1:9200 \
--elasticsearch-port=9200 \
--elasticsearch-enable-auth=1 \
--elasticsearch-username=elastic \
--elasticsearch-password=@el++++++++++++++gar#
Someone has had this problem and managed to solve it or knows how to solve it.
I need help.
Hi @garihogar. Thank you for your report.
To help us process this issue please make sure that you provided the following information:
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento give me 2.4-develop instance - upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
Please, add a comment to assign the issue: @magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.
:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
when you run the installation command:
bin/magento setup:install \
--base-url=https://++++++++.de \
--db-host=localhost \
--db-name=G+++++++bd \
--db-user=G++++++++++0 \
--db-password=@+++++++++++@ \
--admin-firstname=J++++n \
--admin-lastname=W++++r \
--admin-email=jw++++++++++ail.com \
--admin-user=j++++++++s \
--admin-password=B+++++++++k \
--language=en_US \
--currency=USD \
--timezone=America/Chicago \
--use-rewrites=1 \
--search-engine=elasticsearch7 \
--elasticsearch-host=https://127.0.0.1:9200 \
--elasticsearch-port=9200 \
--elasticsearch-enable-auth=1 \
--elasticsearch-username=elastic \
--elasticsearch-password=@el++++++++++++++gar#
the installation stops with the error:
In SearchConfig.php line 81:
Could not validate a connection to Elasticsearch. No alive nodes found in your cluster
My system configuration:
Centos 8
Apache/2.4.37 (centos)
PHP 7.4.9 (cli)
Zend Engine v3.4.0
Zend OPcache v7.4.9
Elasticsearch 7.8.1
mysql Ver 15.1
Steps to reproduce it:
Installation of centos8+LAMP
Installation of Elasticsearch+Config elasticsearch.yml
cluster.name: garihogar
xpack.security.enabled: true
xpack.security.authc.api_key.enabled: true
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: localhost
network.publish_host: 127.0.0.1 (also tested with the following options http://127.0.0.1 | https://127.0.0.1 | http://localhost | http://127.0.0.1:9200 | http://localhost:9200 | http://0.0.0.0:9200 )
network.bind_host: 127.0.0.1 (also tested without this command)
http.port: 9200
transport.tcp.port: 9300 (also tested without this command)
discovery.type: single-node (also tested without this command)
Install composer and run composer command for Magento 2.4
Access the Magento folder in Httpd
Execute installation command
bin / magento: instalar \
--base-url = https: //++++++++.de \
--db-host = localhost \
--db-name = G +++++++ bd \
--db-user = G ++++++++++ 0 \
--db-password = @ +++++++++++ @ \
--admin-firstname = J ++++ n \
--admin-lastname = W ++++ r \
--admin-email = jw ++++++++++ ail.com \
--admin-user = j ++++++++ s \
--admin-password = B +++++++++ k \
--language = en_US \
--divisa = USD \
--zona horaria = Am茅rica / Chicago \
--use-rewrites = 1 \
--search-engine = elasticsearch7 \
--elasticsearch-host = https://127.0.0.1:9200 \ (Tested with the different ip options used)
--elasticsearch-port = 9200 \
--elasticsearch-enable-auth = 1 \
--elasticsearch-username = elastic \
--elasticsearch-password = @ el ++++++++++++++ gar #
The only thing I doubt is the Elasticsearch version. Version 7.8.1 is compatible with Magento 2.4?
I understand it's version 7.6 or higher. No?
Error detected.
I cloned the server, uninstalled Elasticsearch and reinstalled it this time without the authentication enabled and it installed without problem.
I think the bug is in using username and password in localhost
Someone can check what I explain to provide a solution
Got the same issue and could not install even with Auth Basic disabled. Elasticsearch is running and i can $curl and see "200 OK" and the JSON that Elasticsearch provides but still an error during isntallation.
[Edit] Got mine to work. The solution was to install with flag --elasticsearch-host='127.0.0.1'
Also try --elasticsearch-host='127.0.0.1' --elasticsearch-port='81'
I had the same problem because I accidentially entered a wrong port number.
Now I get another error Could not validate a connection to Elasticsearch. null
I verified the username and password myself and they are correct.
So this looks like a magento bug.
I opened the file vendor/magento/module-elasticsearch/Setup/Validator.php and changed the return value in the validate() method to [], now it installed properly.
UPDATE: The reason for my problem was, that I forgot to add --search-engine = elasticsearch7
changing the file vendor/magento/module-elasticsearch/Setup/Validator.php and changing the return value in the validate() method to [], is not working for me
I ttied all I could find and the best i got is

"No alive nodes found in your cluster" erros mesagge
above is the settings from magento admin
here is the setiings for elstic search
cluster.name: elasticsearch
node.name: magento2
network.publish_host: localhost
discovery.seed_hosts: []
network.host: 127.0.0.1
http.port: 9200
cluster.initial_master_nodes: 127.0.0.1
I got centos 7 and apache2,4, mariad db 10 as mysql database
Magento2.4 please help
It works if you add --elasticsearch-host=
Make sure your --elasticsearch-host=<domain> and --elasticsearch-port=<port> query, matches your elasticsearch configurations <domain> and <port>. In my case: --elasticsearch-host=localhost --elasticsearch-port=9200 which you can verify by going to http://localhost:9200/
It should work! I hope it helps.
Has same issue, pretty sure I didn't touch to any configuration, just do the deployment but the problem found
Please check if you have --search-engine=elasticsearch7 in your install command. Also check what happens if you enter the URL in the browser.
So if your host and port is set to this:
--elasticsearch-host=https://127.0.0.1 \
--elasticsearch-port=9200
Then enter https://127.0.0.1:9200 in the browser. If it works, then a javascript object should show.
If you need authentication, then you also have to use this:
--elasticsearch-enable-auth=1 \
--elasticsearch-username=xxxxx \
--elasticsearch-password=yyyyy
Most helpful comment
I had the same problem because I accidentially entered a wrong port number.
Now I get another error
Could not validate a connection to Elasticsearch. nullI verified the username and password myself and they are correct.
So this looks like a magento bug.
I opened the file vendor/magento/module-elasticsearch/Setup/Validator.php and changed the return value in the
validate()method to[], now it installed properly.UPDATE: The reason for my problem was, that I forgot to add
--search-engine = elasticsearch7