Scenario: "Suzhou": MongoDB replicas!
Level: Medium
Type: Fix
Access: Email
Description: A new MongoDB replica set has been setup in the development environment trough /home/admin/app/rs0.js, however, a variety or errors are showing up when trying to bring it up. You should bring up all the replica servers, get them communicating to each other and make sure the replica set is working as it should.
The status of the first replica can be checked via systemctl status mongo1 same for the replicas mongo2 and mongo3. The logs are also in a separate file for each replica under the directory /var/log/mongodb. To initilize the replica set again: mongosh --file app/rs0.js
Note: The default configuration file /etc/mongo.conf is not the problem.
Test: mongosh --eval "rs.status()" | grep health returns the status of all the replicas
health: 1, health: 1, health: 1,
The "Check My Solution" button runs the script
/home/admin/agent/check.sh, which you can see and execute.
Time to Solve: 20 minutes.