Dag
Dag

Reputation: 10539

Migrate MongoDB arbiter

I have a mongodb replica set (which is part of a shard) where I want to migrate the arbiter to a new host. I didn't found any instructions for this case, so I'm not sure how to do this.

My current approach would be to start an arbiter on the new host, add him to the replica set, and then remove the old one. Any suggestions? Thanks.

Upvotes: 0

Views: 1168

Answers (2)

jiahao
jiahao

Reputation: 3393

There is a command much more easier:

rs.addArb("[hostname]:[port]")

http://docs.mongodb.org/manual/administration/replication-architectures/#replica-set-arbiter-nodes

Upvotes: 1

Dag
Dag

Reputation: 10539

In fact it is much simpler:

  1. Start the new arbiter
  2. Connect to the primary member
  3. Execute

    cfg = rs.conf()
    cfg.members[0].host = newhost
    rs.reconfig(cfg)
    
  4. Now you can shut down the old arbiter

Don't forget to change your options (--replSet) in /etc/sysconfig/mongod, if set.

Reference: http://www.mongodb.org/display/DOCS/Adding+an+Arbiter

Upvotes: 4

Related Questions