Question

Using MongoDB in a live server. Everyday in the morning, I find that mongod process is shutdown. The mongodb log is as follows:

2017-11-02T11:19:49.173+0000 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/var/lib/mongodb/diagnostic.data'
2017-11-02T11:19:49.174+0000 I NETWORK  [thread1] waiting for connections on port 27017
2017-11-02T11:19:49.469+0000 I NETWORK  [thread1] connection accepted from 127.0.0.1:34826 #1 (1 connection now open)
2017-11-02T11:20:20.112+0000 I NETWORK  [thread1] connection accepted from 127.0.0.1:34828 #2 (2 connections now open)
2017-11-02T11:27:34.728+0000 I CONTROL  [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
2017-11-02T11:27:34.728+0000 I NETWORK  [signalProcessingThread] shutdown: going to close listening sockets...
2017-11-02T11:27:34.728+0000 I NETWORK  [signalProcessingThread] closing listening socket: 7
2017-11-02T11:27:34.728+0000 I NETWORK  [signalProcessingThread] closing listening socket: 8
2017-11-02T11:27:34.728+0000 I NETWORK  [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
2017-11-02T11:27:34.728+0000 I NETWORK  [signalProcessingThread] shutdown: going to flush diaglog...
2017-11-02T11:27:34.728+0000 I FTDC     [signalProcessingThread] Shutting down full-time diagnostic data capture
2017-11-02T11:27:34.730+0000 I STORAGE  [signalProcessingThread] WiredTigerKVEngine shutting down
2017-11-02T11:27:34.795+0000 I STORAGE  [signalProcessingThread] shutdown: removing fs lock...
2017-11-02T11:27:34.795+0000 I CONTROL  [signalProcessingThread] now exiting
2017-11-02T11:27:34.795+0000 I CONTROL  [initandlisten] shutting down with code:0

My mongodb configuration file is as follows:

# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# Where and how to store data.
storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true
#  engine:
#  mmapv1:
#  wiredTiger:

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1


#processManagement:

#security:

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options:

#auditLog:

#snmp:

Most of the solutions online are related to setting processManagement.fork to false, which I believe is it's default value.

Était-ce utile?

La solution

If fork is false then mongo dies when shell (where you started mongo) die. Set fork to true

Licencié sous: CC-BY-SA avec attribution
Non affilié à dba.stackexchange
scroll top