We currently have a replica set with two full members & one arbiter. Now, I need to promote the arbiter to become a full member. What's the easiest way of going about this? I don't have more servers to play with, so I need to do this with the machines I got.
If I understand you correctly: You want to covert your arbiter to a full mongo server on the same hardware. The 1st thing that you want to consider is if the arbiter hardware is able to support the database. If the arbiter has much less hardware then the other 2 nodes this probably won't turn out well. Many arbiters are run on machines that cannot support a full database. If you want to do this you will need setup the machine as a full node from scratch. There is no way to promote an arbiter to a full member automatically.
To do this: 1)1st need to shutdown the mongod process on the arbiter. Then you may want to check the data directory to make sure it can hold the data, as an arbiter it had none 2)Connect to the primary with the mongo shell. You can use db.isMaster() in the shell to check to see which node is the primary if you are unsure. 3)Use rs.remove("") to remove it from the set. 4)Start the new mongo server up. Ensure that the data directory is empty(it will copy from the replica set). The command is something like mongod --dbpath --replSet . You might have other options given your configuration. 5)On the primary run rs.add() 6)Call rs.conf() to confirm that your configuration is good.
As a side note, you can also sync the data directories between the new node and the primary using rsync for the initial sync. But if your data is small just having mongo do it will be easier. If you need to use rsync please refer to the docs for all the requirements. http://docs.mongodb.org/manual/tutorial/expand-replica-set/
If you have any other questions, please let me know.
Best, Charlie
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With