简体   繁体   中英

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.

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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM