Mongo升级后停止工作

时间:2018-05-16 12:51:54

标签: mongodb

我最近将mongodb从2.6升级到3.4.1,现在它无法连接。日志显示:

root@synctup-stage:~# tail -30 /var/log/mongodb/mongodb.log
2018-05-16T12:16:49.372+0000 [initandlisten] connection accepted from 127.0.0.1:40540 #17 (3 connections now open)
2018-05-16T12:17:22.670+0000 [clientcursormon] mem (MB) res:43 virt:548
2018-05-16T12:17:22.670+0000 [clientcursormon]  mapped (incl journal view):320
2018-05-16T12:17:22.670+0000 [clientcursormon]  connections:3
2018-05-16T12:21:34.334+0000 [conn17] end connection 127.0.0.1:40540 (2 connections now open)
2018-05-16T12:21:44.046+0000 [initandlisten] connection accepted from 127.0.0.1:40542 #18 (3 connections now open)
2018-05-16T12:21:44.054+0000 [conn18] end connection 127.0.0.1:40542 (2 connections now open)
2018-05-16T12:22:22.682+0000 [clientcursormon] mem (MB) res:44 virt:548
2018-05-16T12:22:22.682+0000 [clientcursormon]  mapped (incl journal view):320
2018-05-16T12:22:22.682+0000 [clientcursormon]  connections:2
2018-05-16T12:27:02.682+0000 [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
2018-05-16T12:27:02.682+0000 [signalProcessingThread] now exiting
2018-05-16T12:27:02.682+0000 [signalProcessingThread] dbexit: 
2018-05-16T12:27:02.682+0000 [signalProcessingThread] shutdown: going to close listening sockets...
2018-05-16T12:27:02.682+0000 [signalProcessingThread] closing listening socket: 8
2018-05-16T12:27:02.682+0000 [signalProcessingThread] closing listening socket: 9
2018-05-16T12:27:02.682+0000 [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
2018-05-16T12:27:02.682+0000 [signalProcessingThread] shutdown: going to flush diaglog...
2018-05-16T12:27:02.682+0000 [signalProcessingThread] shutdown: going to close sockets...
2018-05-16T12:27:02.682+0000 [signalProcessingThread] shutdown: waiting for fs preallocator...
2018-05-16T12:27:02.682+0000 [signalProcessingThread] shutdown: lock for final commit...
2018-05-16T12:27:02.682+0000 [signalProcessingThread] shutdown: final commit...
2018-05-16T12:27:02.682+0000 [signalProcessingThread] shutdown: closing all files...
2018-05-16T12:27:02.682+0000 [conn11] end connection 127.0.0.1:35824 (1 connection now open)
2018-05-16T12:27:02.682+0000 [conn10] end connection 127.0.0.1:35822 (1 connection now open)
2018-05-16T12:27:02.684+0000 [signalProcessingThread] closeAllFiles() finished
2018-05-16T12:27:02.684+0000 [signalProcessingThread] journalCleanup...
2018-05-16T12:27:02.684+0000 [signalProcessingThread] removeJournalFiles
2018-05-16T12:27:02.686+0000 [signalProcessingThread] shutdown: removing fs lock...
2018-05-16T12:27:02.686+0000 [signalProcessingThread] dbexit: really exiting now

那里的任何大师都会看到可能会发生什么?

在升级之前一直工作正常,升级似乎进展顺利。

尝试启动mongo shell时出现以下错误:

MongoDB shell version v3.4.15
connecting to: mongodb://127.0.0.1:27017
2018-05-16T12:28:08.006+0000 W NETWORK  [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
2018-05-16T12:28:08.006+0000 E QUERY    [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:240:13
@(connect):1:6
exception: connect failed

1 个答案:

答案 0 :(得分:0)

  

ask ubuntu上给出的简单步骤非常完美...

     

但有一点   在你执行这些步骤之前,那里没有提到过   必须停止mongod.service

请按照以下步骤操作these

  1. sudo service mongod stop
  2. sudo systemctl enable mongodb