Elasticsearch: how to remove one path.data

(Danielmotaleite) #1

I have a elasticsearch setup that started with normal HD, but later i added 2 more SSD in the path.data

Now i'm happy with the SSD and want to remove the HD. How to do it?

My logic says that "transient.cluster.routing.allocation.exclude._path_data" or similar should exist, but i didn't found any... i also suspect that i could use the "cluster.routing.allocation.awareness." to limit the deploy of new index fo the SSD, but also didn't find any way to do it.

So am i missing anything? how can i remove the old directory without losing data? is the only way shutdown the elasticsearch, move any folder in the old HD to the SSD and restart elasticsearch again without the old HD in the path.data?

(Danielmotaleite) #2

So no replies, i assume no easy way to remove one path.data, after having several

(Ryan Ernst) #3

It depends what version you are on. If you are on 1.x, no, you cannot remove path.data entries. Since 2.0, each path.data entry is only used to contain entire shards, not segments as was done previously. As long as you have replication of your index, removing a path.data entry should "work" and simply reallocate the replica to another instance. It sounds like you might be testing with a single node though, in which case the answer is no, removing a path.data entry would result in data loss. Your idea about coalescing the contents of the disks might work, but I would be cautious in trying it (for example, copy all the contents to a new directory, and start ES with that new directory as your sole path.data entry).

(Danielmotaleite) #4

Thanks for the reply!

i'm on 5.5.1 actually and i have another nodes, so what you say is perfectly doable, i can shutdown the node, remove the the old path.data and start it again... the missing shards will be then recovered from the other nodes, i only have to wait for it to finish the cluster to stabilize all the replicas and do the same on the next node.

all this sound lot safer than trying to move the index on the filesystem level :slight_smile:

Again, thanks for the push in the right direction!

(system) #5

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