After adding super administrators and regular users to MongoDB, I tried to restart, but failed. It shows a very strange question:

[[email protected]_0_11_centos /]# service mongod restart
Redirecting to /bin/systemctl restart  mongod.service
Job for mongod.service failed because the control process exited with error code. See "systemctl status mongod.service" and "journalctl -xe" for details.

When I tried to reenter mongodb, the connection failed:

[[email protected]_0_11_centos /]# mongo
MongoDB shell version v3.4.20
connecting to: mongodb://127.0.0.1:27017
2019-06-02T12:04:03.103+0800 W NETWORK  [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
2019-06-02T12:04:03.103+0800 E QUERY    [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
[email protected]/mongo/shell/mongo.js:240:13
@(connect):1:6
exception: connect failed

It is the log of mongo:

2019-06-02T11:57:55.908+0800 I COMMAND  [conn2] command admin.system.version appName: "MongoDB Shell" command: createUser { createUser: "root", pwd: "xxx", roles: [ { role: "root", db: "admin" } ], digestPassword: false, writeConcern: { w: "majority", wtimeout: 600000.0 } } numYields:0 reslen:22 locks:{ Global: { acquireCount: { r: 6, w: 4 } }, Database: { acquireCount: { r: 1, W: 4 } }, Collection: { acquireCount: { r: 1, w: 3 } } } protocol:op_command 201ms
2019-06-02T12:00:56.119+0800 I -        [conn2] end connection 127.0.0.1:46604 (1 connection now open)
2019-06-02T12:02:13.168+0800 I CONTROL  [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
2019-06-02T12:02:13.168+0800 I NETWORK  [signalProcessingThread] shutdown: going to close listening sockets...
2019-06-02T12:02:13.168+0800 I NETWORK  [signalProcessingThread] closing listening socket: 7
2019-06-02T12:02:13.168+0800 I NETWORK  [signalProcessingThread] closing listening socket: 8
2019-06-02T12:02:13.168+0800 I NETWORK  [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
2019-06-02T12:02:13.168+0800 I NETWORK  [signalProcessingThread] shutdown: going to flush diaglog...
2019-06-02T12:02:13.168+0800 I FTDC     [signalProcessingThread] Shutting down full-time diagnostic data capture
2019-06-02T12:02:13.170+0800 I STORAGE  [signalProcessingThread] WiredTigerKVEngine shutting down
2019-06-02T12:02:13.456+0800 I STORAGE  [signalProcessingThread] shutdown: removing fs lock...
2019-06-02T12:02:13.456+0800 I CONTROL  [signalProcessingThread] now exiting
2019-06-02T12:02:13.456+0800 I CONTROL  [signalProcessingThread] shutting down with code:0

Can you help me, please?

0 Answers