我有一台ubuntu 16.04服务器(1核,2GB RAM(,去年安装了MongoDB v4.2.1。最近遇到这个问题,mongod服务正在运行,但我的nodejs应用程序崩溃了。重新启动mongod后问题消失
MongoDB日志:
2020-10-03T13:30:15.869+0330 I CONTROL [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
2020-10-03T13:30:15.887+0330 I NETWORK [signalProcessingThread] shutdown: going to close listening sockets...
2020-10-03T13:30:15.887+0330 I NETWORK [signalProcessingThread] removing socket file: /tmp/mongodb-2717.sock
2020-10-03T13:30:15.905+0330 I - [signalProcessingThread] Stopping further Flow Control ticket acquisitions.
2020-10-03T13:30:15.917+0330 I FTDC [signalProcessingThread] Shutting down full-time diagnostic data capture
2020-10-03T13:30:15.930+0330 I STORAGE [signalProcessingThread] Deregistering all the collections
2020-10-03T13:30:15.933+0330 I STORAGE [signalProcessingThread] Timestamp monitor shutting down
2020-10-03T13:30:15.934+0330 I STORAGE [signalProcessingThread] WiredTigerKVEngine shutting down
2020-10-03T13:30:15.936+0330 I STORAGE [signalProcessingThread] Shutting down session sweeper thread
2020-10-03T13:30:15.936+0330 I STORAGE [signalProcessingThread] Finished shutting down session sweeper thread
2020-10-03T13:30:15.936+0330 I STORAGE [signalProcessingThread] Shutting down journal flusher thread
2020-10-03T13:30:15.986+0330 I STORAGE [signalProcessingThread] Finished shutting down journal flusher thread
2020-10-03T13:30:15.986+0330 I STORAGE [signalProcessingThread] Shutting down checkpoint thread
2020-10-03T13:30:15.988+0330 I STORAGE [signalProcessingThread] Finished shutting down checkpoint thread
2020-10-03T13:30:16.338+0330 I STORAGE [signalProcessingThread] shutdown: removing fs lock...
2020-10-03T13:30:16.347+0330 I CONTROL [signalProcessingThread] now exiting
2020-10-03T13:30:16.349+0330 I CONTROL [signalProcessingThread] shutting down with code:0
2020-10-03T13:30:16.861+0330 I CONTROL [main] ***** SERVER RESTARTED *****
--fork选项只能在手动启动mongod时使用,例如,如果使用systemd,进程本身会变成守护进程,而--fork选择会导致这种崩溃。