I am using warden for magento 2.4 in shell when I run bin/magento s:up
I am facing following error:
could not validate a connection to Elasticsearch. No alive nodes found in your cluster
For Magento 2.4 Elasticsearch is mandatory. So you need to setup Elasticsearch. When running setup:upgrade it also needs Elasticsearch connection and alive nodes. You can set it in Magento admin Stores > Configuration > Catalog > Catalog > Catalog Search. Or you can add entries direct in database in core_config_data table catalog/search/elasticsearch7_server_hostname
and catalog/search/elasticsearch7_server_port
(Elasticsearch 7).
If you have it set already, check what is blocking connection.
Magento 2.4.x template comes latest so when installing Magento 2.4.x you need to install elasticsearch first.
In my case I was upgrading magento from 2.3.6 to 2.4.4. (PHP 8.1, Elasticsearch 7.16) My local environment was Warden on Ubuntu 20.04. To get rid of this error "Could not validate a connection to Elasticsearch. No alive nodes found in your cluster" (that was popping up during bin/magento setup:upgrade) I had to do two things:
bin/magento module:enable {Magento_Elasticsearch,Magento_InventoryElasticsearch,Magento_Elasticsearch7}
bin/magento module:disable Magento_Elasticsearch6
Hope, that my answer will help someone :)