Migrate ElasticSearch data

Environment setup

apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: elasticsearch
spec:
version: 7.6.2
nodeSets:
- name: master-legacy
count: 1
config:
node.master: true
node.data: false
node.ingest: false
node.store.allow_mmap: false
volumeClaimTemplates:
- metadata:
name: elasticsearch-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
storageClassName: legacy-block
- name: data-legacy
count: 2
config:
node.master: false
node.data: true
node.ingest: true
node.store.allow_mmap: false
volumeClaimTemplates:
- metadata:
name: elasticsearch-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: legacy-block
NAME                                                  STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
elasticsearch-data-elasticsearch-es-data-legacy-0 Bound pvc-86d4a99d-0f0d-4355-9e68-1b3dd0b6eaee 10Gi RWO legacy-block 9s
elasticsearch-data-elasticsearch-es-data-legacy-1 Bound pvc-a8f6aadc-b84c-488b-905e-3db608f6a45d 10Gi RWO legacy-block 9s
elasticsearch-data-elasticsearch-es-master-legacy-0 Bound pvc-b0dadd8a-ed5c-424d-b0fb-d97731892b4b 5Gi RWO legacy-block 9s
NAME                                READY   STATUS    RESTARTS   AGE
elasticsearch-es-data-legacy-0 1/1 Running 0 65s
elasticsearch-es-data-legacy-1 1/1 Running 0 65s
elasticsearch-es-master-legacy-0 1/1 Running 0 65s
- name: data-pure
count: 2
config:
node.master: false
node.data: true
node.ingest: true
node.store.allow_mmap: false
volumeClaimTemplates:
- metadata:
name: elasticsearch-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: pure-file

Data migration

NAME                                READY   STATUS        RESTARTS   AGE
elasticsearch-es-data-legacy-0 1/1 Terminating 0 58m
elasticsearch-es-data-legacy-1 1/1 Terminating 0 58m
elasticsearch-es-data-pure-0 1/1 Running 0 15m
elasticsearch-es-data-pure-1 1/1 Running 0 15m
elasticsearch-es-master-legacy-0 1/1 Running 0 58m

Master node migration

- name: master-pure
count: 1
config:
node.master: true
node.data: false
node.ingest: false
node.store.allow_mmap: false
volumeClaimTemplates:
- metadata:
name: elasticsearch-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
storageClassName: pure-file
NAME                                READY   STATUS    RESTARTS   AGE
elasticsearch-es-data-pure-0 1/1 Running 0 20m
elasticsearch-es-data-pure-1 1/1 Running 0 20m
elasticsearch-es-master-legacy-0 1/1 Running 0 63m
elasticsearch-es-master-pure-0 1/1 Running 0 41s
elasticsearch-data-elasticsearch-es-data-pure-0       Bound    pvc-4ade5d4b-c4cd-4544-aa81-1439c9e47f67   10Gi       RWO            pure-file      19m
elasticsearch-data-elasticsearch-es-data-pure-1 Bound pvc-2c601757-f7a8-42c6-918d-1d525fe855c1 10Gi RWO pure-file 19m
elasticsearch-data-elasticsearch-es-master-legacy-0 Bound pvc-b0dadd8a-ed5c-424d-b0fb-d97731892b4b 5Gi RWO legacy-block 63m
elasticsearch-data-elasticsearch-es-master-pure-0 Bound pvc-82bc87c8-9e97-4a8c-88f2-0194d82476cc 5Gi RWO pure-file 10s

--

--

--

Infrastructure engineering for modern data applications

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

A verstatile Git utility that reduces the pain of resolving merge conflicts

Buy Please|Codechef solution in Python

Sorting Algorithms Continued: What Is Recursion?

How to Open C files on Android? Ultimate Guide

how to open C files on android

Roadmap to Becoming a Front-end Developer in 2022

Navigating the Unknown

Mavericks Dmg

Tips on passing CKAD exam

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
jboothomas

jboothomas

Infrastructure engineering for modern data applications

More from Medium

What’s a File, What’s a Block, What’s an Object?

How to Connect Elastic Sink Connector with Kafka

Index Alias — ElasticSearch

Automating clustered columnstore indexes for your SQL data warehouse