Moving the elastic directory

Hi,

So as can be the problem when you wander blindly in the dark I've set up an elastic box as a VM and given it 2TB of disk however not realising that the /root directory on Linux was its own partition that's where I've set things up and so I'm not starting to find I'm running out of disk at that partition was only 50GB

The data that is in there represents a significant volume of effort and I don't want to have to recreate it. So I wanted to see if either of these 2 solutions would work.

  1. stop all processed feeding elastic
    shut down elastic
    move the folder from root to opt
    start back up
    restart feeder processes

  2. As I'm thinking of putting it on it's own physical hardware anyway
    Set up a new box
    put everything in the right place this time
    give it the same cluster name
    wait for it to replicate
    decommission the old box.

or if they won't does anyone know what will?

May thanks
Ant

Hello,
the first procedure, that requires downtime sounds ok. don't forget to make elasticsearch point to the new data location through path.data in elasticsearch.yaml.

The second one, that relies on replication, will work if you have one node only, you start a new one, and set number_of_replicas to 1 and then wait for replication to be completed. At that point you should have fully replicated indices, which means that you can afford to take one of the two nodes down without losing data. Otherwise you could also play with shard allocation settings and manage to reroute all shards to the new node before bringing the old one down, which you would do only when empty.

Cheers
Luca

1 Like

Thank you Luca,

I only have the one node at the moment so that should all be good, if I can't source the box before it runs out I may do option 1 to buy myself a bit more time.

I think the paths are not set so going to defaults so would I be right in thinking that so long as I move the whole folder it would look for them based on them being in the same place respective of the elastic binary?

Many Thanks
Ant

Not sure I got it, but you mean that you would fix the partitions and the path of the directory would still be the same? In that case it would continue to work. If the path differs from the previous one you do have to go update the path.data.

Cheers
Luca

1 Like

Luca,

I think that makes sense, thank you for the clarification.

Kind Regards
Ant