I just upgraded from mongodb 3.4 to 4.4, after that the database won't start.
As a service.....
[root@ssdnodes-54313 mongo]# systemctl restart mongod
Job for mongod.service failed because the control process exited with error code.
See "systemctl status mongod.service" and "journalctl -xe" for details.
-- Unit mongod.service has begun starting up.
Dec 09 15:30:22 ssdnodes-54313 mongod[217641]: about to fork child process, waiting until server is ready for connections.
Dec 09 15:30:22 ssdnodes-54313 mongod[217641]: forked process: 217643
Dec 09 15:30:22 ssdnodes-54313 mongod[217641]: ERROR: child process failed, exited with 1
Dec 09 15:30:22 ssdnodes-54313 mongod[217641]: To see additional information in this output, start without the "--fork" option.
Dec 09 15:30:22 ssdnodes-54313 systemd[1]: mongod.service: Control process exited, code=exited status=1
Dec 09 15:30:22 ssdnodes-54313 systemd[1]: mongod.service: Failed with result 'exit-code'.
Dec 09 15:30:22 ssdnodes-54313 systemd[1]: Failed to start MongoDB Database Server.
Executing mongod ....
[root@host mongo]# mongod --fork --logpath /var/log/mongodb/mongod.log
about to fork child process, waiting until server is ready for connections.
forked process: 217394
ERROR: child process failed, exited with 100
To see additional information in this output, start without the "--fork" option.
Executing without --fork (does nothing, no error, no server listening)
[root@host mongo]# mongod --logpath /var/log/mongodb/mongod.log
[root@host mongo]#
If I start as :
[root@host mongo]# mongod --dbpath /var/lib/mongo
{"t":{"$date":"2020-12-09T15:28:43.674+00:00"},"s":"I", "c":"CONTROL", "id":23285, "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2020-12-09T15:28:43.687+00:00"},"s":"W", "c":"ASIO", "id":22601, "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
{"t":{"$date":"2020-12-09T15:28:43.691+00:00"},"s":"I", "c":"NETWORK", "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
{"t":{"$date":"2020-12-09T15:28:43.698+00:00"},"s":"I", "c":"STORAGE", "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":217522,"port":27017,"dbPath":"/var/lib/mongo","architecture":"64-bit","host":"ssdnodes-54313"}}
Do works! but how do I fork it to run in background and start as a service at boot-time.
Edit: my /etc/mongod.conf
[root@ssdnodes-54313 ~]# cat /etc/mongod.conf
# mongod.conf
# 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.
File permissions:
[root@ssdnodes-54313 lib]# ls -la /var/lib
drwxr-xr-x 4 mongod mongod 4096 Dec 9 18:50 mongo
[root@ssdnodes-54313 lib]# ls -la /var/lib/mongo/
total 556
drwxr-xr-x 4 mongod mongod 4096 Dec 9 18:50 .
drwxr-xr-x. 40 root root 4096 Dec 9 14:01 ..
-rw------- 1 mongod mongod 32768 Dec 9 15:32 collection-0--1818581548198400736.wt
-rw------- 1 mongod mongod 36864 Dec 9 15:33 collection-0--4356046170403439820.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:34 collection-0-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:34 collection-10-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:34 collection-12-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:35 collection-14-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:35 collection-16-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:35 collection-18-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:35 collection-20-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:35 collection-22-7358854442417001382.wt
-rw------- 1 mongod mongod 24576 Dec 9 16:23 collection-2--4356046170403439820.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:36 collection-24-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:36 collection-26-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:34 collection-2-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:34 collection-4-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:34 collection-6-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:34 collection-8-7358854442417001382.wt
drwx------ 2 mongod mongod 4096 Dec 9 18:50 diagnostic.data
-rw------- 1 mongod mongod 4096 Dec 9 15:34 index-11-7358854442417001382.wt
-rw------- 1 mongod mongod 32768 Dec 9 15:32 index-1--1818581548198400736.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:34 index-13-7358854442417001382.wt
-rw------- 1 mongod mongod 36864 Dec 9 15:33 index-1--4356046170403439820.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:35 index-15-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:34 index-1-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:35 index-17-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:35 index-19-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:35 index-21-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:35 index-23-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:36 index-25-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:36 index-27-7358854442417001382.wt
-rw------- 1 mongod mongod 12288 Dec 9 16:24 index-3--4356046170403439820.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:34 index-3-7358854442417001382.wt
-rw------- 1 mongod mongod 12288 Dec 9 18:50 index-4--4356046170403439820.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:34 index-5-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:34 index-7-7358854442417001382.wt
-rw------- 1 mongod mongod 4096 Dec 9 15:34 index-9-7358854442417001382.wt
drwx------ 2 mongod mongod 4096 Dec 9 15:32 journal
-rw------- 1 mongod mongod 36864 Dec 9 15:36 _mdb_catalog.wt
-rw------- 1 mongod mongod 7 Dec 9 15:32 mongod.lock
-rw------- 1 mongod mongod 36864 Dec 9 16:23 sizeStorer.wt
-rw------- 1 mongod mongod 114 Dec 9 15:17 storage.bson
-rw------- 1 mongod mongod 47 Dec 9 15:17 WiredTiger
-rw------- 1 mongod mongod 4096 Dec 9 15:32 WiredTigerHS.wt
-rw------- 1 mongod mongod 21 Dec 9 15:17 WiredTiger.lock
-rw------- 1 mongod mongod 1256 Dec 9 18:50 WiredTiger.turtle
-rw------- 1 mongod mongod 143360 Dec 9 18:50 WiredTiger.wt
SELinux is disabled...
[root@ssdnodes-54313 log]# sestatus
SELinux status: disabled