2

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 :)

techraf
  • 4,353
  • 10
  • 32
  • 43
Jayy
  • 566
  • 2
  • 6
  • 19

2 Answers2

4

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]
>
techraf
  • 4,353
  • 10
  • 32
  • 43
0

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

sudo systemctl unmask mongodb

then re-run

sudo service mongod start