I upgraded 1 of the 2 data nodes in my 3 node cluster (3rd node is voting only and does not store any data) from 7.17.2 to 8.1.2. Post the upgrade, Elasticsearch service is crashing with the following error:
Exception
java.lang.IllegalStateException: unexpected folder encountered during data folder upgrade: /mnt/ssd1/var/lib/elasticsearch/nodes/0/_state_30-05-2021
Few more lines from the logfile
[2022-04-20T04:48:42,732][INFO ][o.e.e.NodeEnvironment ] [secondarynode] oldest index version recorded in NodeMetadata 7.8.1
[2022-04-20T04:48:42,733][ERROR][o.e.b.Bootstrap ] [secondarynode] Exception
java.lang.IllegalStateException: unexpected folder encountered during data folder upgrade: /mnt/ssd1/var/lib/elasticsearch/nodes/0/_state_30-05-2021
at org.elasticsearch.env.NodeEnvironment.upgradeLegacyNodeFolders(NodeEnvironment.java:431) ~[elasticsearch-8.1.2.jar:8.1.2]
This is not a folder that Elasticsearch would create so it looks like someone or something else has been meddling with the contents of the data path. This is very strongly not recommended and can lead to all sorts of problems.
I would recommend restoring the cluster from a snapshot into a clean data path.
Thank you very much @DavidTurner. It is odd since the host is exclusively an ES node. Further the data of ES is written to another SSD from the OS, meaning the /mnt/ should have no other data written even from the OS.
I will need to replace the SSD meaning the new one will have no data (but the Elasticsearch settings and the OS will remain as is). Hence, is following feasable for recovery?:
Attach a new SSD to the VM with the same mounth path as the previous one.
Upgrade last remaining ES data node to 8.1.2. This node has all of the data.
Yes, if your cluster health is yellow then you can simply replace this node with a new (empty) 8.1.2 one and let Elasticsearch rebuild its contents. I recommend waiting until the health is green before upgrading the final node.
I am not sure why, but I get these when 1 of the two master node goes down.
maybe it is because of discovery.seed_hosts: ["primarynode", "secondarynode", "votingonlynode"]
Anything in the logs? Assuming your credentials are correct I guess this means the cluster health is not yellow. I suggest downgrading secondarynode back to 7.17.2 until you work out what's going on here. Downgrades typically don't work but it should be ok here since unexpected folder encountered during data folder upgrade happens so early in startup.
I've got a new SSD and the VM is up and running. Secondarynode has Elasticsearch 8.1.2 running (I got a prompt for 8.1.3 - I reckon Elastic needs to come up with an update release cycle )
The status seems to be red since I have no enabled routing of shards.
Should I upgrade the last node to 8.1.3 - this is the only node with data right now an enable the routing of shards to sync primary (running 7.17.2) and secondary nodes? or enable sync before the upgrade so that there are two copies of the data?
I think you should have downgraded as per my previous message, at least until you work out what's going on. The cluster is in red health now so it seems you've lost some primary shards.
Thanks David. I will start the rebuild process. I have taken snapshots of the data including full backup of the VMs before attempting quick and of course ignorant fix. Sorry for that and thank you very much.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.