Database Reference
In-Depth Information
Let's assume we have a
primary
node in our existing server, then we add a new node to
the existing replica set. Obviously, initially it will be a
secondary
node. This
sec-
ondary
node is empty, but it synchronizes its
oplog
with the primary server inside the
existing server. This depends on the amount of data on the existing server, the network
connection, and the hardware configurations.
To migrate a single
mongod
instance, there are different ways, but all of them have at
least a brief outage. Generally, the procedure to move the standalone
mongod
instance is
as follows:
1. Stop the existing node.
2. Copy the data to a new server.
3. Start a new node.
4. Point applications to a new address.
The following diagram illustrates this procedure: