zepgram/magento2-fast-vm

No alive nodes found in your cluster

srgrbkl opened this issue · 7 comments

i have error in magento 2.4.0
Elasticsearch: No alive nodes found in your cluster
i use these settings:
Screenshot_1

service elasticsearch start - helped me, but it is inconvenient to enter this command every time when 'vagrant up'

I think need to add these commands to shell file:
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service

Can you tell me what is the value of "JAVA_HOME" in your /etc/default/elasticsearch ?

On elasticsearch7 it must be:
"JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre"

I had this issue but it should be solved here:
https://github.com/zepgram/magento2-fast-vm/blob/master/provision/020-system-services.sh#L212

correct, i have same value by default:
"JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre"
but i still get notification

This command is supposed to be run 1 time, then at every start up the service is started, according to elasticsearch doc https://www.elastic.co/guide/en/elasticsearch/reference/7.x/deb.html#deb-running-systemd:

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service

And it's done here:
https://github.com/zepgram/magento2-fast-vm/blob/master/provision/020-system-services.sh#L214

you're right, but after research, I noticed that elasticsearch spontaneously turns off.
maybe it depends on the specific development environment and if you don't have a solution I'll close the ticket.
log have this string:
Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[project+_product_1_v1][4]] ...]).
Desired survivor size 4358144 bytes, new threshold 6 (max 6)

  • age 1: 1396384 bytes, 1396384 total
    : 76672K->7369K(76672K), 0.0574012 secs] 255322K->194276K(1040064K), 0.0574933 secs] [Times: user=0.03 sys=0.00, real=0.05 secs]
    2020-08-28T14:34:04.916+0000: 99.234: Total time for which application threads were stopped: 0.0577695 seconds, Stopping threads took: 0.0000961 seconds
    2020-08-28T14:34:05.937+0000: 100.255: Total time for which application threads were stopped: 0.0109358 seconds, Stopping threads took: 0.0108091 seconds
    2020-08-28T14:34:06.348+0000: 100.665: [GC (Allocation Failure) 2020-08-28T14:34:06.348+0000: 100.665: [ParNew
    Desired survivor size 4358144 bytes, new threshold 6 (max 6)
  • age 1: 1796616 bytes, 1796616 total
  • age 2: 550672 bytes, 2347288 total
    : 75529K->4196K(76672K), 0.0415688 secs] 262436K->191102K(1040064K), 0.0416456 secs] [Times: user=0.01 sys=0.00, real=0.04 secs]
    2020-08-28T14:34:06.389+0000: 100.707: Total time for which application threads were stopped: 0.0419103 seconds, Stopping threads took: 0.0000835 seconds

I found out a way to do this here: elastic/ansible-elasticsearch#371

Could you run this and confirm this is working ? I'll create a new tag if it works.

mkdir /etc/systemd/system/elasticsearch.service.d
cat <<'EOF' > /etc/systemd/system/elasticsearch.service.d/override.conf
[Service]
Restart=always
EOF
/bin/systemctl daemon-reload
/bin/systemctl enable elasticsearch.service
/bin/systemctl start elasticsearch.service