Reputation: 63
while i want to active mongo on linux i get this error and it and it wont work
$ sudo systemctl status mongod
● mongod.service - MongoDB Database Server Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: disabled) Active: failed (Result: signal) since Sun 2021-08-01 13:39:18 +03; 47s ago Docs: https://docs.mongodb.org/manual Process: 12854 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=killed, signal=ILL) Main PID: 12854 (code=killed, signal=ILL) CPU: 19ms
Aug 01 13:39:18 jr systemd[1]: Started MongoDB Database Server. Aug 01 13:39:18 jr systemd[1]: mongod.service: Main process exited, code=killed, status=4/ILL Aug 01 13:39:18 jr systemd[1]: mongod.service: Failed with result 'signal'.
and while i type mongod it say
$ mongod
zsh: illegal hardware instruction mongod
Upvotes: 4
Views: 29170
Reputation: 81
Also had the same problem and the above answer did help tremendously, but I found a couple stuff missing. My issue was also of the processor compatibility and required to uninstall the version I had installed and install a earlier version of MongoDB.
Here are the steps I followed, that did it for me
First, Uninstall the MongoDB version you had installed, requires removing the used repo from the sources.list
, otherwise it will just keep installing that one (or latest version), even after uninstalling it. So to remove the repo from the sources.list
follow these steps:
List the contents of sources.list directory using
ls -l /etc/apt/sources.list.d/
Remove the repo(s) using the command
sudo rm /etc/apt/sources.list.d/<repo_name>
Once the repo(s) are removed, uninstall MongoDB. Use these commands:
sudo apt purge "mongodb-org*"
sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongodb
After uninstalling MongoDB, you might want to update the package list, so use
sudo apt update
From here onward, you can follow the steps for installing the lower version of MongoDB you want as outlined in the manual. Just make sure you select the version you want.
If it happens that the earlier version you get to also throws the same error, repeat the process, going to an earlier version still.
Upvotes: 2
Reputation: 21
Downgrade to 4.4
first, remove MongoDB
sudo apt-get purge mongodb-org*
sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongodb
sudo rm -rf /etc/apt/sources.list.d/mongodb-org-5.0.list
install MongoDB 4.4
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-
key add -
This worked for me seems to be a hardware problem, especially the CPU
Upvotes: 1
Reputation: 71
i had the same problem with the same message. Seems to be a problem of processor compability.
Found this post https://www.mongodb.com/community/forums/t/mongodb-5-0-cpu-intel-g4650-compatibility/116610
Check if your pocessor has the flags mentioned in the answer with the command:
cat /proc/cpuinfo
if not, you can try with an older version of mongo. In my case my processor can't handle mongo4.4, but installed mongo4.2 and works fine, but depends of your processor and SO.
Upvotes: 6