I’ve followed the brilliant tutorial on installing 2.4 exactly as set out by Craig and all was well until the last command…
bin/magento setup:upgrade
It returns the following lines with the last one about Elasticsearch in Red…
Cache cleared successfully
File system cleanup:
/var/www/html/generated/code/Composer
/var/www/html/generated/code/Dotdigitalgroup
/var/www/html/generated/code/Magento
/var/www/html/generated/code/PayPal
/var/www/html/generated/code/Symfony
/var/www/html/generated/code/Yotpo
The directory '/var/www/html/generated/metadata/' doesn't exist - skipping cleanup
/var/www/html/pub/static/deployed_version.txt
/var/www/html/var/view_preprocessed/pub
Updating modules:
Could not validate a connection to Elasticsearch. No alive nodes found in your cluster
Can someone point me in the right direction, please?
I’ll take another look at it tomorrow as I need to leave it now.
That’s strange. I’d tested Elasticsearch earlier in the process yesterday and it was running.
I’ve started the Elasticsearch once again and tested.
Then I’ve gone back into /var/www/html but when I run…
bin/magento cache:clean
I get the warning in Red…
cache_dir "/var/www/html/var/page_cache" is not writable
In the end, I had to reboot the server.
I tested Elastic search and it was working.
Then went from chapter 9 onwards but it still has the elastic search issue and now I’m stuck at the cmd prompt ‘>’ and I don’t know how to get back to magento@ubuntu-mage2-stylerep:
chris@ubuntu-mage2-stylerep:/var/www/html$ su magento
Password:
magento@ubuntu-mage2-stylerep:/var/www/html$
magento@ubuntu-mage2-stylerep:/var/www/html$ curl -X GET 'http://localhost:9200'
{
"name" : "Magento Node",
"cluster_name" : "Magento Cluster",
"cluster_uuid" : "lRbzzn9iQvSlqlP-y8DrUA",
"version" : {
"number" : "7.6.0",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "7f634e9f44834fbc12724506cc1da681b0c3b1e3",
"build_date" : "2020-02-06T00:09:00.449973Z",
"build_snapshot" : false,
"lucene_version" : "8.4.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
magento@ubuntu-mage2-stylerep:/var/www/html$ bin/magento deploy:mode:set developer
Enabled developer mode.
magento@ubuntu-mage2-stylerep:/var/www/html$ rm -rf generated/metadata/* generated/code/*
magento@ubuntu-mage2-stylerep:/var/www/html$ bin/magento cache:clean
Cleaned cache types:
config
layout
block_html
collections
reflection
db_ddl
compiled_config
eav
customer_notification
config_integration
config_integration_api
full_page
config_webservice
translate
vertex
magento@ubuntu-mage2-stylerep:/var/www/html$ bin/magento sampledata:deploy
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
<warning>Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.</warning>
<warning>Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.</warning>
<warning>Package sebastian/finder-facade is abandoned, you should avoid using it. No replacement was suggested.</warning>
Generating autoload files
81 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
PHP CodeSniffer Config installed_paths set to ../../magento/magento-coding-standard,../../phpcompatibility/php-compatibility
magento@ubuntu-mage2-stylerep:/var/www/html$ bin/magento setup:upgrade
Cache cleared successfully
File system cleanup:
/var/www/html/generated/code/Composer
/var/www/html/generated/code/Dotdigitalgroup
/var/www/html/generated/code/Magento
/var/www/html/generated/code/PayPal
/var/www/html/generated/code/Symfony
/var/www/html/generated/code/Yotpo
The directory '/var/www/html/generated/metadata/' doesn't exist - skipping cleanup
/var/www/html/pub/static/deployed_version.txt
/var/www/html/var/view_preprocessed/pub
Updating modules:
Could not validate a connection to Elasticsearch. No alive nodes found in your cluster
magento@ubuntu-mage2-stylerep:/var/www/html$
All looks good aside from the bit at the end. Did you by chance set any Elasticsearch variables when you ran the Magento Install script originally? I wonder if a typo lead to Magento looking for the wrong port or something.
Went through it all over again, right from the start and still got the ElasticSearch Issue.
magento@ubuntu-mage2-stylerep:/var/www/html$ bin/magento setup:upgrade
Cache cleared successfully
File system cleanup:
/var/www/html/generated/code/Composer
/var/www/html/generated/code/Dotdigitalgroup
/var/www/html/generated/code/Magento
/var/www/html/generated/code/PayPal
/var/www/html/generated/code/Symfony
/var/www/html/generated/code/Yotpo
The directory '/var/www/html/generated/metadata/' doesn't exist - skipping cleanup
/var/www/html/pub/static/deployed_version.txt
/var/www/html/var/view_preprocessed/pub
Updating modules:
Could not validate a connection to Elasticsearch. No alive nodes found in your cluster
magento@ubuntu-mage2-stylerep:/var/www/html$ curl elasticsearch:9200
curl: (6) Could not resolve host: elasticsearch
magento@ubuntu-mage2-stylerep:/var/www/html$ curl -X GET 'http://localhost:9200'
curl: (7) Failed to connect to localhost port 9200: Connection refused
Any thoughts? Has anyone successfully followed the tutorial?
Tried again but this time with ElasticSearch 7.9.2 and Magento 2.4.1
Everything was fine until’ 9.3 Download Sample Data via Composer’
magento@ubuntu-mage2-stylerep:/var/www/html$ bin/magento sampledata:deploy
<warning>Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2.0 is about to be released and the older 1.x releases will self-update directly to it once it is released. To avoid surprises update now to the latest 1.x version which will prompt you before self-updating to 2.x.</warning>
./composer.json has been updated
Loading composer repositories with package information
<warning>Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2.0 is about to be released and the older 1.x releases will self-update directly to it once it is released. To avoid surprises update now to the latest 1.x version which will prompt you before self-updating to 2.x.</warning>
Updating dependencies (including require-dev)
Killed
magento@ubuntu-mage2-stylerep:/var/www/html$
I’ve repeated the installation once again from the beginning following your method and versions exactly with the same error message. As it’s the fourth time i’ve followed the instructions faithfully there’s either something wrong with the digital ocean platform or there’s some code that’s not working correctly.
magento@ubuntu-mage2-stylerep:/var/www/html$ bin/magento setup:upgrade
Cache cleared successfully
File system cleanup:
/var/www/html/generated/code/Composer
/var/www/html/generated/code/Dotdigitalgroup
/var/www/html/generated/code/Magento
/var/www/html/generated/code/PayPal
/var/www/html/generated/code/Symfony
/var/www/html/generated/code/Yotpo
The directory '/var/www/html/generated/metadata/' doesn't exist - skipping cleanup
/var/www/html/pub/static/deployed_version.txt
/var/www/html/var/view_preprocessed/pub
Updating modules:
Could not validate a connection to Elasticsearch. No alive nodes found in your cluster
magento@ubuntu-mage2-stylerep:/var/www/html$
sorry to jump on this thread but I am facing the same issue. setup:upgrade gives the no node alive error. even on the Magento admin backend. curl 9200 gives the right response.
my web config is:
Magento 2.4.1
server: Nginx
php-fpm 7.4.3
elastic search 7.6.0