I
I
ikerya2018-11-06 17:00:25
MongoDB
ikerya, 2018-11-06 17:00:25

Why is the MongoDB daemon process being killed?

Hello. From time to time, about a couple of times a day, the web server, which is implemented on NodeJS, starts to issue errors to the console of the following form:

(node:29001) UnhandledPromiseRejectionWarning: MongoNetworkError: failed to reconnect after 30 attempts with interval 1000 ms

I counted 5 errors of this kind in the console, after which other errors began to appear:
(node:29001) UnhandledPromiseRejectionWarning: MongoError: topology was destroyed

The daemon process itself ( service status mongod ) is killed, as I understand it, due to such errors.
Result of service status mongod :

● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: signal) since Tue 2018-11-06 16:36:04 MSK; 1min 11s ago
Docs: https://docs.mongodb.org/manual
Process: 18434 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=killed, signal=KILL)
Main PID: 18434 ( code=killed, signal=KILL)
Nov 06 09:53:02 www systemd[1]: Started MongoDB Database Server.
Nov 06 09:53:02 www mongod[18434]: 2018-11-06T09:53:02.563+0300 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocol
s 'none'
Nov 06 16:36:04 www systemd[1]: mongod.service: Main process exited, code=killed, status=9/KILL
Nov 06 16:36:04 www systemd[1]: mongod.service: Unit entered failed state.
Nov 06 16:36:04 www systemd[1]: mongod.service: Failed with result 'signal'.

I "solve" the problem by restarting the daemon ( service mongod restart ). It’s inconvenient to do this every time, and you don’t want to turn a blind eye to mistakes either. Tell me, how can I find out why such a mess begins?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lega, 2018-11-06
@lega

Take a look at the syslog, maybe this oom-killer kills the mogu when it starts to eat all the memory (if so, then there is not enough memory), also make a swap if not already (and if there is, what does it show?).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question