Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have recently installed MongoDB server on Ubuntu. It was working and I use id from PHP too but, I don't know why it started failing. It's the first time I use mongodb so I am a bit lost.

Actually, when trying to access via PHP or via shell to mongo:

root@ubuntu:~# /etc/init.d/mongodb restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mongodb restart

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop mongodb ; start mongodb. The restart(8) utility is also available.
mongodb start/running, process 7223
root@ubuntu:~#

root@ubuntu:~# mongo
MongoDB shell version: 1.6.3
Wed Sep  7 10:20:35 *** warning: spider monkey build without utf8 support.  consider rebuilding with utf8 support
connecting to: test
Wed Sep  7 10:20:35 Error: couldn't connect to server 127.0.0.1 (anon):1137
exception: connect failed
root@ubuntu:~#

The first time I used the spider monkey error wasn't there. And it worked. I tried reinstalling and nothing.

How I can solve that?

Thank you in advance! Any info I can add let me know, please.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

As it said, try this:

# start mongodb

Also take a look at Upstart - an event-based replacement for the SysV init.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.