Configuring a MongoDB replica set

This recipe teaches you how to configure replication using MongoDB replica sets.

When replication is performed using replica sets, one installation of MongoDB identifies as the primary server while others in the cluster are secondaries. The primary server accepts writes, which are replicated to the secondaries, while the secondaries service read requests. If the primary server goes down, the secondary servers automatically call a quorum and promote one of the secondaries to fill the primary's role. The old primary rejoins the cluster when it comes back on line. This configuration provides redundancy, distributed read/write access, and automatic failover for high-availability.

Getting ready

This recipe demonstrates ...

Get CentOS 7 Server Deployment Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.