LMSouq
server-admin Open

MongoDB on Ubuntu won't start as a service, nothing in the log

BI
BishopZ
1 month ago
3 views
Problem Description
Am running MongoDB 2.2 on Ubuntu and if I run: sudo mongod I get an error that it can't find /data/db, which is not where the database is. In mongod.conf the database path is specified as the Ubuntu 10gen default `/var/lib/mongodb` which is where the db is located. Seems like `mongod` is not finding the conf file. So when I run: sudo mongod -f /etc/mongodb.conf The server starts up fine and output is logged to the log file: `/var/log/mongodb/mongodb.log`. All is happy. I can switch to another shell, log into mongo shell, see the databases and run queries. So, I cancel out of that and try to run as a service: > sudo status mongodb mongodb stop/waiting > sudo start mongodb mongodb start/running, process 10468 Looks good so far, but the mongo server did not start. Running another: > sudo status mongodb mongodb stop/waiting > mongo MongoDB shell version: 2.2.0 connecting to: test Sat Sep 1 19:07:43 Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91 exception: connect failed "test" is not the correct database, and nothing appears in the log file. I am at a loss as to what could be wrong. I checked the upstart scripts and they seem fine. `/etc/init/mongodb.conf` runs: mongodb --exec /usr/bin/mongod -- --config /etc/mongodb.conf

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base