Move all data in a path to other path (different mount)

Hello guys,
I have 250 gb ES in /data/elasticsearch/ (/dev/sda1).
The disk space is 60 gb left. I want to add new disk space using LVM (/dev/mapper/data-dataes)
Do you guys have any idea to move all whole data into new path (new mount) ?
I believe i need to change my path.data from /data/elasticsearch to be /data_es/elasticsearch but, how does elasticsearch reach old data in /data/elasticsearch ?

FYI, this is elasticsearch cluster. So, i have 3 instances.
I am using Elasticsearch 5.6.3.

Is this documentation helping me ? https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cluster-reroute.html

Thank you for your time and information

If you have created a new LV to get more data, you may be missing a feature of LVM.

Look at this: https://www.tecmint.com/lvm-storage-migration/

You can use LVM mirroring to move the physical data. Basically you create a mirror on the new (larger) location, let it complete the mirroring, then delete the old mirror. Your data is moved and your application never knows (It may degrade performance)

Yep.

It doesn't. You would need to mv the data in the old directory to the new one when Elasticsearch is not running.

Just make sure you take a backup, as this is not a supported process.

If you need to use mv, look at the "rolling upgrade" procedures. Turn off shard routing, stop this node, do the mv, restart the node. If it worked, turn on shard routing. If you have all indexes set to replicate, you should have backiup copies on the other 2 nodes.

Thank you for your time...
I have 3 instances...
A-node, B-node, and C-node... all of these nodes are receiving LIVE data right now.
Should i stop only one of them in the meantime ?
This is the POC

  1. curl -X PUT "localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d' { "transient": { "cluster.routing.allocation.enable": "none" } } '

  2. service elasticsearch stop

  3. change path.data to be /data_es/elasticsearch

  4. mv /data/elasticsearch /data_es/elasticsearch

  5. curl -X PUT "localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d' { "transient": { "cluster.routing.allocation.enable": "all" } } '

is there the way to upgrade disk space without Elasticsearch stopped ?
Like, i deploy new instance and add it to existing instances configuration and then it will be resharding automatically.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.