peter.petrov
peter.petrov

Reputation: 39477

MongoDB - startup - Ubuntu/Linux

I read the docs I could find on the web but still I don't see what I am doing wrong.
I also saw there're 2-3 similar questions here on SO but not quite the same.
I tried both methods of starting it up but none of them works, it seems.

root@test02:~# service mongod start
mongod start/running, process 1135
root@test02:~# /etc/init.d/mongod
Usage: /etc/init.d/mongod COMMAND
root@test02:~# /etc/init.d/mongod start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mongod start

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start mongod
mongod start/running, process 1154
root@test02:~# ps aux | grep mongo
root      1157  0.0  0.1   9392   896 pts/0    S+   19:04   0:00 grep --color=auto mongo
root@test02:~#

So... nothing happens, no log files are created too.

1) What am I missing here?!

2) When I run it this way (through both ways),
will it know to use the /etc/mongod.conf file?

These are the relevant files which I have for MongoDB.

/etc/init.d/mongod

/etc/mongod.conf

/root/.mongorc.js

/var/log/mongodb/mongod.log

The last one does not exist in fact, though it should be there, I think.

Upvotes: 3

Views: 6069

Answers (3)

ffflabs
ffflabs

Reputation: 17511

For this kind of problems, you basically need to check if the logfile is writable by user mongodb, and increase the verbosity in the configuration file. vv = true

Upvotes: 2

peter.petrov
peter.petrov

Reputation: 39477

The problem here was that my mongod.conf file was incorrect syntactically.
I had some bad content in it. Apparently this was preventing mongod from
starting up properly. And unfortunately the reason for this was not being
reported very well (or I was not checking it where I should have).

Upvotes: 0

wojciii
wojciii

Reputation: 4323

You are not missing anything.

service mongod start

The service was started according to your copy&pasted terminal output and then probably died. Look in syslog for clues why or some other logfiles produced by mongodb.

Upvotes: 1

Related Questions