Magento 2 Installation Error Could Not Validate a Connection to Elasticsearch – No alive nodes found in your cluster is mainly occurs during the installation of Magento 2.
To fix this error you have checked with the Elasticsearch is working properly background. This error occurs due to Magento is not being connected to Elasticsearch. It is mainly due to Elasticsearch is not running.
Complete Solution of Magento 2 Installation Error Could Not Validate a Connection to Elasticsearch
To fix this error, you to the section where the Elacticsearch is downloaded. Then go into the Elacticsearch folder path \elasticsearch\elasticsearch-7.12.1\bin for the file name elasticsearch.bat
Then right-click on this file to start the working of Elasticsearch.
You will be going to see the results of the process of working given below.
Keep this process of woking window background.
To check on your system regarding the Elaticsearch is working or not, run the URL localhost:9200 on your browser. If the result you get is shown below then Elasticsearch is working properly.
For checking the status of Elacticsearch, you have to use the below helpful command
cd <path_to_the_bin_directory_of_elasticsearch> Ex.- C:\Users\Raju>cd C:\xampp\htdocs\elasticsearch-7.12.1\bin
and then run the below command.
curl -X GET "localhost:9200/_cluster/health?pretty"
You will get the output as given below.
As the result of the status, if you will get “green” or “yellow”.This status means that Elacticsearch is ready to grant your request and if it shows the result status is red, then Elacticsearch is not completely functioning.
If you want to check more in detail, go for the log of Elacticsearch present inside the log folder.
And if you get a message as given below
curl: (7) Failed to connect to localhost port 9200: Connection refused
The meaning of this result is Elacticsearch down. If it is down then again restart and if it is not helpful, then check the log or contact your host provider.