3

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.

3
  • Actually, I missed the obvious /var/log/mongodb/mongod.log. Take a look inside there and see what it's complaining about. I remember needing to create a data directory for the service to store its files at before. Commented May 28, 2014 at 23:33
  • @Dropped.on.Caprica There was no such file, that was written in my question. Commented May 28, 2014 at 23:35
  • If you aren't seeing a log file specified in the mongod.conf file, I don't know. I'd ensure there's a folder in the /data/db directory, it seems its the default location. If that doesn't work, I don't know what to tell you. Commented May 28, 2014 at 23:40

3 Answers 3

2

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

Sign up to request clarification or add additional context in comments.

2 Comments

Well, the file "was writable" because later on when I fixed my mongod.conf file, I was able to start the mongod service without any permission changes to the log file. In fact when mongod didn't want to start up, this log file was not even there (that was noted in my question's text). Thanks for your reply though.
Sure, but as you said the same symptoms can amout for a different root cause. Having a logfile writable only by root (for example) will result in failure to start the daemon, and of course it would leave no trace in the logfile. Other common mistakes can behave the same way unless you set some extra verbosity. This was apparently your case, and also happens, for example, when an unclean shutdown fails to remove the lockfile mongo.lock
1

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.

7 Comments

No, it's not started. When I run the client app, it does not connect. Also see my "ps aux" check. Where are these log files? I don't see any in the location I am looking at.
What does the log files say?
That's the thing, where are these log files? I don't have any under /var/log/mongodb/
Did you check what is in syslog?
I am not so good with Linux. I don't know how... Still +1 for trying to help.
|
0

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.