DBAtlas · Database operations atlas

Add a member to the replica set

MongoDBReplica Set

Command

rs.add({ host: "mongo2:27017", priority: 1, votes: 1 })

What it does

Adds a new member (secondary) to the existing replica set and starts an initial sync.

When to use it

When adding a new node to increase read capacity or for redundancy.

Caution

The new member pulls data from the primary during initial sync; with large data sets this creates network and disk load.

Open in DBAtlas →

Related