We have a 2 node cluster which has all master, data, ingest and ml roles. This ECK setup is deployed using Oracle Cloud for Kubernetes Engine (OKE).
Recently, we were trying to upgrade the Kubernetes version on OKE nodes, since lower minor version support is removed by Oracle.
While doing this upgrade, first of all, we shifted elastic-operator in one of the new nodes. After which, we had to shift data node. As per "Storage Recommendations" page on ECK Documentation for "Host Failure" topic, we deleted only one node Pod (out of 2) and related PVC. The expected was that the data from old PV will get transferred to new PV. However, we noticed that both the Elasticsearch nodes were failing with below error.
"message": "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes] is empty on this node
if you are upgrading your Kubernetes provider (OKE) you don't have to do anything on ECK, behind the scenes it will drain the node and run a rolling upgrade and the statefulset will recreate the pod into another node while upgrading the first one and the corresponding PVC will be re-attached to the new node using the existing PV.
Now, if you delete the PV there's no way to recover the data/disk because you just deleted it. There's no way to delete the PVC if the Elasticsearch pod is still running.
Remember that you should always consider taking an Elasticsearch snapshot before you perform any kind of upgrade, in case of failure you can easily recover it from there.
On the Elasticsearch setting, it's very important to have at the least 3 nodes (as I mentioned before) and each indices must have at the least 1 replica, with that you can guarantee high-availibility during upgrades, you should also consider your OKE setting, if you have only one node there's nothing we can do.
During the node drain, we did not face any issue with elastic-operator pod. The operator pod started running fine on the new node as you mentioned.
However, while doing the drain for master nodes (quickstart-es-nodeset), the Pod went into Pending state. When described this pod, we observed that none of the available nodes matched Pod's volumeAffinity. Upon checking ECK documentation, I deleted PVC of that Pod. With this, the new Pod came up with new PVC but it was throwing MasterNotDiscoveredException.
Right now, I want to understand how I can resolve this MasterNotDiscoveredException and get master nodes running.
Also, as you suggested, I am planning to upgrade nodeset with 3 replicas. With old ECK cluster master nodes being down, will elastic-operator copy the data from old PVs to the new nodeset cluster PVs?
This documentation you are referring to is assuming you are running Elasticsearch in a resilient or high-availability configuration. The documentation also only applies to local persistent volumes (it is not clear to me from your post if you are using that kind of volume but I assume so for the moment)
As @framsouza said the data on the disk you deleted is probably gone. You will have to rebuild your cluster from scratch. You can potentially salvage the remaining data on the node that is still running with the help of the elasticsearch-node tool by re-bootstrapping the cluster as single node cluster.
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.