I am trying to install and start a MongoDB on a fresh installation of Ubuntu 20 (it’s literally the first thing I did after
sshing onto the server).
I followed the setup tutorial and did the following steps:
curl -fsSL https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
sudo apt-get update
sudo apt-get -y install mongodb-org
sudo systemctl start mongod
When I run
sudo systemctl status mongod I get the following error:
mongod.service - MongoDB Database Server Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled) Active: failed (Result: core-dump) since Sun 2021-08-22 23:25:56 CEST; 2s ago Docs: https://docs.mongodb.org/manual Process: 86514 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=dumped, signal=ILL) Main PID: 86514 (code=dumped, signal=ILL) Aug 22 23:25:55 Ubuntu20-64Bit systemd: Started MongoDB Database Server. Aug 22 23:25:56 Ubuntu20-64Bit systemd: mongod.service: Main process exited, code=dumped, status=4/ILL Aug 22 23:25:56 Ubuntu20-64Bit systemd: mongod.service: Failed with result 'core-dump'.
If I simply run
mongod I get the following error:
Illegal instruction (core dumped)
This is my configuration (unchanged after installing, located at /lib/systemd/system/mongod.service):
[Unit] Description=MongoDB Database Server Documentation=https://docs.mongodb.org/manual After=network-online.target Wants=network-online.target [Service] User=mongodb Group=mongodb EnvironmentFile=-/etc/default/mongod ExecStart=/usr/bin/mongod --config /etc/mongod.conf PIDFile=/var/run/mongodb/mongod.pid # file size LimitFSIZE=infinity # cpu time LimitCPU=infinity # virtual memory size LimitAS=infinity # open files LimitNOFILE=64000 # processes/threads LimitNPROC=64000 # locked memory LimitMEMLOCK=infinity # total threads (user+kernel) TasksMax=infinity
I already checked the mongoDB-logs, it seems like MongoDB crashes before creating any logs at all because the folder is empty.
I am not sure if that is normal but I looked for the environment file at
/etc/default/mongod (see in config) but it doesn’t exist…
I tried the following things to fix this error:
- Restart the service with
- Uninstalling MongoDB with
sudo apt-get purge mongodb-org*, deleting all
/var/lib/mongodbdirectories and all other files containing the name
mongo, as well as the user and usergroup
- Completely resetting the server and reinstalling Ubuntu (on version 20 and 21).
- installing version 4.4 of Mongo DB
Interesting to note might be that I once had a Mongo DB running on this server but I had to reset the server after completly deleting the
/var/log/ directories (yes I should have researched a little before doing this ). The MongoDB stopped working then but I am pretty sure that my server provider has reset everything of these previous versions of the server after I clicked reset and they reinstalled ubuntu (all of the other things are deleted as well).
I am really stuck here, I hope someone has an idea because MongoDB is essential to the stuff I’m working on atm…