Check MongoDB Replica Set Status
To check the master-slave status of MongoDB, you can use the following method:
- Connect to the primary server using the Mongo shell command line interface, then run the rs.status() command. This will display the replication status of the primary server, including information on the primary and secondary servers.
- Connect to the primary server using a MongoDB management tool (such as MongoDB Compass) and navigate to the “Replica Set” tab. This will display the status information of the primary and secondary servers, including their roles and health status.
- Search for replication-related log information in the MongoDB log files on the primary server. The log files are typically located in the “log” folder within the MongoDB installation directory. The replication-related log information will provide the current status of both the primary and secondary servers.
Regardless of the method used, you should be able to check the master-slave status of MongoDB and understand the health of the replica set.