0

Apologies if this has been asked a bunch of times (it has, sorry!) but I can't find a solution that works.

I'm line for line following: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/

When I sudo systemctl start mongdb:

● mongod.service - MongoDB Database Server
   Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
   Active: failed (Result: core-dump) since Sat 2021-10-02 17:28:51 EEST; 15min ago
     Docs: https://docs.mongodb.org/manual
  Process: 10714 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=dumped, signal=ILL)
 Main PID: 10714 (code=dumped, signal=ILL)

I've updated the mongod.service file as per [this answer][1]

and in accordance with the answers in that same question, ran the following commands:

chown -R mongodb:mongodb /var/lib/mongodb
chown mongodb:mongodb /tmp/mongodb-27017.sock

though for also ran it for var/log/mongodb (note that these folders are empty? I created a txt file named mongodb.log manually, the file itself is empty and there are no mongo related files in tmp, so the latter command of course failed

Given some of these folders are missing/empty, I ran

mk@Swankey:~$ sudo mongod --repair
Illegal instruction

So following [this question][2] I tried the following commands, nothing has changed, still at square one here.

:~$ sudo rm -r /var/lib/mongodb
:~$ sudo mkdir -p /var/lib/mongodb/
:~$ sudo chown -R mongodb:mongodb /var/lib/mongodb/
:~$ sudo mkdir -p /var/log/mongodb/
:~$ sudo chown -R mongodb:mongodb /var/log/mongodb/
:~$ sudo systemctl restart mongod
:~$ sudo systemctl status mongod
● mongod.service - MongoDB Database Server
   Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: e
   Active: failed (Result: core-dump) since Sat 2021-10-02 17:18:09 EEST; 7s ago
     Docs: https://docs.mongodb.org/manual
  Process: 10657 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=dumpe
 Main PID: 10657 (code=dumped, signal=ILL)

PS I have ran purge mongo* and reinstalled multiple times I'm at a loss here

Similar to the second question thread linked, when I install the package mongodb (as opposed to mongodb-org the service will run? I'd prefer to follow the official documentation hence using mongodb-org

  [1]: https://askubuntu.com/a/884652
  [2]: https://askubuntu.com/questions/929198/fail-to-start-mongod-service-but-mongodb-service
  [3]: https://stackoverflow.com/questions/29554521/uninstall-mongodb-from-ubuntu
Maitiu
  • 11
  • @user535733 I've edited now, the first one at least, only 'enabled' was cut off so I didn't edit the second message (which is the same anyway) – Maitiu Oct 02 '21 at 14:47

1 Answers1

1

Ok so after several failures and online searching, I've come across this answer in StackOverflow, which basically suggests MongoDB 5.0 needs a newer cpu in order to run

I'll admit that I've not actually tried this yet (downgrading) due to the constraints (already wasted a full weekend on this) but it is highly possible to be the case given my cpu is quite old, and that when I downloaded the mongodb package (as in the Ubuntu one, not the 'offical' mongodb-org package, it worked. I believe this Ubuntu mongodb package is the 3.somthing version)

I'll leave this as a potential answer as I'm sure it may help someone with a laptop as old as mine.

Will edit if this works for me

Maitiu
  • 11