Change disk on arbiter node

I have a mongodb replicaset consisting of 3 nodes

node-01 - primary
node-02 - secondary
node-03 - arbiter node

so on the arbiter node i have a big disk attached to /var /lib /mongo partition, but due to the fact that the arbiter node does not use disk space so much, I want to unmount the disk /var /lib /mongo and so that the data is on / partition, I want to do the procedure like this

  1. stop mongodb
  2. rsync data in /
  3. unmount the disk
  4. run mongodb
    Did I specify everything correctly?

@Gregory_Rybalka

I’d highly recommend making it a data node. Review some recent threads involving arbiters in the replica sets.

Check the replicaset health before stopping the arbiter.
Make sure you’re preserving the uid, gid and permissions with the rsync.
Change the arbiters configuration to use the new directory, or symlink it.

If you’re on CentOS or RedHat you will need to set the SELinux context of the new directory if you have SELinux set to enforcing. I don’t think you would need to update mongod’s policy. In my opinion it would be better to rsync it back to /var/lib/mongo and reset the context.

1 Like

Thank you so much! but what is wrong with the arbiter?

@chris :slightly_smiling_face: it’s interesting why arbiter is bad?

@MaBeuLux88 Covers it nicely.

2 Likes