Hey everyone, I’m not really much of a MongoDB user, but I have a web application, part of which relies on Mongo, that I’m trying to install. I have a CentOS 7 server running WHM/cPanel and I’ve followed the setup instructions and it all seems to be installed, but when I try to start the service I get Job for mongod.service failed because a timeout was exceeded. See "systemctl status mongod.service" and "journalctl -xe" for details.
systemctl status mongod.service gives me this:
`● mongod.service - MongoDB Database Server
Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
Active: failed (Result: timeout) since Fri 2020-12-11 04:49:27 UTC; 1min 58s ago
Docs: https://docs.mongodb.org/manual
Process: 26266 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=0/SUCCESS)
Process: 26263 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS)
Process: 26260 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS)
Process: 26257 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS)
Dec 11 04:47:57 chess.gates.com mongod[26266]: about to fork child process, waiting until server is ready for connections.
Dec 11 04:47:57 chess.gates.com mongod[26266]: forked process: 26268
Dec 11 04:47:58 chess.gates.com mongod[26266]: child process started successfully, parent exiting`
and journalctl:
journalctl -f _COMM=mongod -- Logs begin at Mon 2020-03-23 05:08:30 UTC. -- Dec 05 02:36:33 chess.gates.com mongod[14579]: child process started successfully, parent exiting Dec 11 03:20:15 chess.gates.com mongod[22034]: about to fork child process, waiting until server is ready for connections. Dec 11 03:20:15 chess.gates.com mongod[22034]: forked process: 22036 Dec 11 03:20:17 chess.gates.com mongod[22034]: child process started successfully, parent exiting Dec 11 03:27:44 chess.gates.com mongod[22405]: about to fork child process, waiting until server is ready for connections. Dec 11 03:27:44 chess.gates.com mongod[22405]: forked process: 22407 Dec 11 03:27:45 chess.gates.com mongod[22405]: child process started successfully, parent exiting Dec 11 04:47:57 chess.gates.com mongod[26266]: about to fork child process, waiting until server is ready for connections. Dec 11 04:47:57 chess.gates.com mongod[26266]: forked process: 26268 Dec 11 04:47:58 chess.gates.com mongod[26266]: child process started successfully, parent exiting
My mongod.conf is just the default:
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
# Where and how to store data.
storage:
dbPath: /var/lib/mongo
journal:
enabled: true
# engine:
# wiredTiger:
# how the process runs
processManagement:
fork: true # fork and run in background
pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile
timeZoneInfo: /usr/share/zoneinfo
# network interfaces
net:
port: 27017
bindIp: 127.0.0.1 # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
#security:
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options
#auditLog:
#snmp:
This bit seems relevant:
{"t":{"$date":"2020-12-11T04:47:58.316+00:00"},"s":"W", "c":"FTDC", "id":23913, "ctx":"initandlisten","msg":"Error checking directory '{sysBlockPathStr}': {ec_message}","attr":{"sysBlockPathStr":"/sys/block","ec_message":"No such file or directory"}}
And it’s right, there’s no /sys/block folder on my server and it won’t let me create it either (mkdir: cannot create directory ‘block’: No such file or directory
), and I’m not sure what the function of this folder is meant to be or why it’s not there.
But the bit that actually stops it running seems to be this:
{“t”:{“$date”:“2020-12-11T04:49:27.287+00:00”},“s”:“I”, “c”:“CONTROL”, “id”:23377, “ctx”:“SignalHandler”,“msg”:“Received signal”,“attr”:{“signal”:15,“error”:“Terminated”}}
{“t”:{“$date”:“2020-12-11T04:49:27.287+00:00”},“s”:“I”, “c”:“CONTROL”, “id”:23378, “ctx”:“SignalHandler”,“msg”:“Signal was sent by kill(2)”,“attr”:{“pid”:1,“uid”:0}}
{“t”:{“$date”:“2020-12-11T04:49:27.287+00:00”},“s”:“I”, “c”:“CONTROL”, “id”:23381, “ctx”:“SignalHandler”,“msg”:“will terminate after current cmd ends”}`
I don’t know what this could mean other than the system is terminating mongo for some reason. This is where I could use some help: where do I start in figuring out what’s killing it? Has anyone successfully run mongo in a similar environment before with any success?
Sorry for the long message and general lack of knowledge, and thanks in advance to anyone who can help me