saeedeh
saeedeh

Reputation: 89

Mongo shuts down abruptly without any log

I get this recurring problem, where Mongo shuts down on the server without any log. I get this error message:

com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=localh ost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}]

and then I check mongo, and it has shut down. But there is absolutely nothing in the log about it crashing or anything. This is the log from mongod.log:

2019-08-27T18:08:48.590+0430 I COMMAND [conn29] command db.news command: find { find: "news", filter: { _id: "3bb30383-fa65-4899-99e9-938c5f4979c9" }, limit: 1, singleBatch: true } planSummary: IDHACK keysExamined:1 docsExamined:1 cursorExhausted:1 numYields:1 nreturned:1 reslen:28344 locks:{ Global: { acquireCount: { r: 4 } }, Database: { acquireCount: { r: 2 } }, Collection: { acquireCount: { r: 2 } } } protocol:op_query 189ms

2019-08-28T08:45:24.522+0430 I CONTROL [main] ***** SERVER RESTARTED


As you can see the first line is the latest query and the second is me running it again.

I am in no way an expert or a sysadmin, and this problem in very concerning so I would very much appreciate any help or guidance you could give me.

Upvotes: 0

Views: 2625

Answers (1)

mohamin
mohamin

Reputation: 74

If there is not any log about MongoDB crash, it might the OS has killed mongo processes(due to memory limit problems).you can check killed processes via this command:

  • dmesg -T| grep -E -i -B100 'killed process'

Upvotes: 5

Related Questions