Error report of mongodb startup under Linux

Version:MongoDB 5.0.3

1. Use the configuration file to start the error 1:

View log:

  The reason is an error in the configuration file:

#mongod.conf

net:

        bindIp: localhost,172.20.10.9         # 172.20.10.9 LAN IP for host computer

After 172.20.10.9 of bindip is deleted, it can be started successfully, but the host cannot connect to mongodb. At this time, by changing bindip to bindipall: true, it means that all IPS are allowed to connect to this mongodb

If you want to configure multiple IP addresses but do not want all IP addresses to be accessible, the above instructions are used, and the partition cannot be started. Query the network and learn that it is configured through [IP1, IP2], and the result is also an error:

Conclusion:       If it is only accessed locally, you can configure localhost in bindip,

                 If other IPS want to access, they can only configure bindip: 0.0.0.0 or bindipall: true

2. Use the configuration file to start error 2:

Problem cause: caused by abnormal shutdown

Solution: delete the. Lock file under the data directory, and then specify the data directory to start by — dbpaht or add the — repair parameter. After successful startup, start it by using the configuration file method

3. Add in replica set   No response when arbitrating nodes

Problem: by executing the shell in the master node, rs.addarb (host: port) does not respond, and the arbitration node cannot be added. At this time, the version is 5.0.3

Solution: reduce the version to 4.0.1

Read More: