Getting Started
What is MongoDB?
Install / Config
C.R.U.D. Ops
Data Modeling
Database Mgmt
MongoDB Database Management
Replica Set Troubleshooting
What if you have two primaries?
.
You can run
rs.initiate()
ONLY on the first member of the replica set!
On the secondary which acts like a primary, clear the folder indicated by
dbpath
Restart the secondary
What if the primary can "see" the secondary,
but not the other way around?
.
Run
rs.conf()
and make sure all servers can access all hostnames
Check firewall settings
What about firewall settings?
.
You need to allow an exception for MongoDB
Messages you might see when attempting to sync:
SELinux:
security alert
Windows:
Windows Firewall alert
What if replicas are not syncing?
.
FIRST:
run rs.conf()
Make sure all hostnames are entered into DNS
or in the local "hosts" file of all computers in the replica set
THEN TRY:
ping hostname|DNS name
mongo --host hostname|DNS name --port 27017
Correct any communcations errors
What if you have only one secondary?
.
use local
db.system.replset.update({_id:"XXX"},{$set:{members:[{_id:0,host:"HHH:27017"}]}})
Where "XXX" is the replica set ID
and "HHH" is the hostname of the secondary
Restart MongoDB
How can you get more information?
.
docs.mongodb.org/manual/tutorial/troubleshoot-replica-sets/
+
o
-