1

I'm trying to install MongoDB on Jessie. (Never used MongoDB before).

Following this tutorial I did the following:

apt-get update
apt-get upgrade
apt-get install mongodb-server -y
service mongod start

But that gives me this error:

Failed to start mongod.service: Unit mongod.service failed to load: No such file or directory.

What am I doing wrong?

I have looked around but can't make heads or tails of what I've found - all other examples seem to be doing far more complicated things to get it started! PS. I'm doing everything as root because I like the simple & dangerous approach :)

3

It shows an error, because the correct service name is mongodb and the tutorial contains a typo.

Execute:

service mongodb start

and enjoy MongoDB:

$ mongo
MongoDB shell version: 2.4.10
connecting to: test
Server has startup warnings:
Fri Dec 30 19:04:35.967 [initandlisten]
Fri Dec 30 19:04:35.967 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
Fri Dec 30 19:04:35.968 [initandlisten] **       32 bit builds are limited to less than 2GB of data (or less with --journal).
Fri Dec 30 19:04:35.968 [initandlisten] **       See http://dochub.mongodb.org/core/32bit
Fri Dec 30 19:04:35.970 [initandlisten]
>
-1

Most probably unit mongodb.service is masked. Use following command to unmask it.

sudo systemctl unmask mongodb

then re-run

sudo service mongod start

  • Most probably unit mongodb.service is masked No. If you re-read question and answer then you will see that the cause was a simple typo – Dirk Nov 21 '18 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.