Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDB failed (result: core-dump)? [closed]

Tags:

mongodb

ubuntu

I'm attempting to setup MongoDB on Ubuntu 20.04.02 LTS by following the documentation. I have ensured this is a fresh install. However an error persists when I verify if the MongoDB install started succesfully by typing in:

sudo systemctl status mongod

● mongod.service - MongoDB Database Server Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor prese> Active: failed (Result: core-dump) since Wed 2021-08-11 12:59:20 UTC; 49s > Docs: https://docs.mongodb.org/manual Process: 3190 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=dum> Main PID: 3190 (code=dumped, signal=ILL)

Aug 11 12:59:19 discorddomagoj systemd1: Started MongoDB Database Server. Aug 11 12:59:20 discorddomagoj systemd1: mongod.service: Main process exited,> Aug 11 12:59:20 discorddomagoj systemd1: mongod.service: Failed with result '>

Picture of problem for clarity: picture of problem

like image 459
Cascavel Avatar asked Dec 09 '25 12:12

Cascavel


1 Answers

MongoDB 5+ need CPU with AVX instruction, downgrade to MongoDB 4 is the solution.

1.Stop the mongod process by issuing the following command:-

    sudo service mongod stop

2.Remove any MongoDB packages that you had previously installed:-

    sudo apt-get purge mongodb-org*

3.Remove MongoDB databases and log files:-

    sudo rm -r /var/log/mongodb
    sudo rm -r /var/lib/mongodb

4.Then reinstall mangodb 4.4.8

5.Import the public key used by the package management system:-

    wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -

6.The following instruction is for Ubuntu 20.04 (Focal):-

    echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

7.Update Apt

    sudo apt-get update

8.Install mongodb

    sudo apt-get install mongodb-org=4.4.8 mongodb-org-server=4.4.8 mongodb-org-shell=4.4.8 mongodb-org-mongos=4.4.8 mongodb-org-tools=4.4.8

9.Use mongod --version to check its succesfully installed

10.If u encounter any error while using mongod

    sudo mkdir /data
    cd /data
    sudo mkdir db
    sudo pkill -f mongod

11.Then use sudo mongod command.

like image 72
Abdul Wahhab Avatar answered Dec 12 '25 23:12

Abdul Wahhab



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!