kubernetes rolling update for elasticsearch

7/26/2018

I am performing a simple rolling update for elasticsearch image. The command I use is

kubectl set image deployment master-deployment elasticsearch={private registry}/elasticsearch:{tag}

However, the elasticsearch always gets IOException after the rolling update.

Caused by: java.io.IOException: failed to read [id:60, legacy:false, file:/var/lib/elasticsearch/nodes/0/_state/global-60.st]

I have checked the directory /var/lib/elasticsearch/nodes/0/_state/. It has global-10.st file present but not global-60.st.

How should I make sure the image itself synchronizes well with the files present?

-- Jiashen Cao
elasticsearch
kubernetes

1 Answer

7/26/2018

I think you should go with statefulSet and external storage (I.e pvc - don’t store the data inside the pod. )

-- cohenjo
Source: StackOverflow