MongoDB mongod server fails to start after installation and solution

MongoDB mongod server fails to start after installation and solution

Created:07 Apr 2022 00:55:48 , in  Host development

Recently I had to install MongoDb on a machine running Debian/GNU Linux 10 Buster. I followed the official installation guide. The database installed without any problem. However when I checked the status of mongod service I noticed it had failed to start.

Here is the status:


mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: failed (Result: signal) since Wed 2021-08-18 11:58:29 MSK; 4s ago
Docs: https://docs.mongodb.org/manual
Process: 13899 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=killed, signal=ILL)
Main PID: 13899 (code=killed, signal=ILL)

I tried to restart the server, but it would not get up.

Solution

The reason, why mongod server could not start was. MongoDB relies on libmkl-dev and libmkl-avx2 libraries, botch of which Debian distribution does not provide by default. Moreover, they are not even available unless non-free package repository is enabled.

So, in order to install the two libraries, log in as root user (or switch to privileged user with sudo), enable non-free repository in your /etc/apt/sources.list by adding non-free after URLS of official Debian repositories, save and close the file.

Then, remove faulty mongoDB packaged from your machine.


$ apg-get purge mongodb-org 

Finally, install all three required packages, start and enable mongod service:


$ apt-get install libmkl-dev libmkl-avx2 mongodb-org
$ systemctl start mongod
$ systemctl enable mongod

Type the following command to make sure the MongoDB database server is working:


$ systemctl status mongod

If everything went ok, you should get status response which looks like this:


mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: e
Active: active (running) since Tue 2022-04-05 01:42:12 BST; 1 day 22h ago
Docs: https://docs.mongodb.org/manual
Main PID: 749 (mongod)
Memory: 25.5M
CGroup: /system.slice/mongod.service
        └─749 /usr/bin/mongod --config /etc/mongod.conf

Take a closer look at the third line of the status, which tells the mongod service is up and running.

This post was updated on 07 Apr 2022 00:56:49

Tags:  MongoDB 


Author, Copyright and citation

Author

Sylwester Wojnowski

Author of the this article - Sylwester Wojnowski - is a sWWW web developer. He has been writing computer code for the websites and web applications since 1998.

Copyrights

©Copyright, 2024 Sylwester Wojnowski. This article may not be reproduced or published as a whole or in parts without permission from the author. If you share it, please give author credit and do not remove embedded links.

Computer code, if present in the article, is excluded from the above and licensed under GPLv3.

Citation

Cite this article as:

Wojnowski, Sylwester. "MongoDB mongod server fails to start after installation and solution." From sWWW - Code For The Web . https://swww.com.pl//main/index/mongodb-mongod-server-fails-to-start-after-installation-and-solution

Add Comment

Allowed BB Code - style tags: [b][/b], [i][/i], [code=text][/code],[code=javascript][/code],[code=php][/code],[code=bash][/code],[code=css][/code],[code=html][/code]


I constent to processing my data given through this form for purposes of a reply by the administrator of this website.

Recent Comments

Nobody has commented on this post yet. Be first!