1. Setup Mongo and Set a Configuration File
In all the 3 servers adjust the configuration file /etc/mongod.conf:
#Select your replication set name
replication: oplogSizeMB:Disable the bind_ip parameter to avoid binding to only 127.0.0.1 interfacereplSetName:
#bind_ip
2. Restart All 3 mongod Daemons
> sudo service mongod restart
3. Create an Initial Configuration on the Primary
Login to the primary mongo and create an initial configuration. Please notice to use the private IP and not the loopback address (127.0.0.1):
> mongo
3. Create an Initial Configuration on the Primary
Login to the primary mongo and create an initial configuration. Please notice to use the private IP and not the loopback address (127.0.0.1):
> mongo
Primary> cfg = {"_id" : "[replication_set_name]", "members" : [{"_id" : 0,"host" : "[Primary_Host_IP]:27017"}]}
Primary> rs.initiate(cfg);
4. Add the Failover Instance to the Replication Set
Primary> rs.add("[Failover_Host_IP]:27017")
5. Add the Arbier Instance to the Replication Set
Primary> rs.addArb("[Arbiter_Host_IP]:27017")
6. Verify the Replication Set Status
Primary> rs.status()
Bottom Line
I wish every data cluster setup was as easy as a setup of a MongoDB replication set.
Keep Performing,
Moshe Kaplan
6. Verify the Replication Set Status
Primary> rs.status()
I wish every data cluster setup was as easy as a setup of a MongoDB replication set.
Keep Performing,
Moshe Kaplan