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 replaced the mongodb-10gen install with the Ubuntu package (mongodb-server, mongodb-client and dev).

apt-get install mongodb

Thereafter, I am now unable to connect to the REST interface, where it worked before.

Doing a wget to http://127.0.0.1:27018, I receive the following response:

Connecting to 127.0.0.1:27018... failed: Connection refused.

My previous /etc/mongodb.conf file had the following in:

#enable REST
rest = true

Adding it to the packaged conf file does not resolve the issue, not even after restarting.

I also tried changing the following with no effect:

# Disable the HTTP interface (Defaults to localhost:27018).
# nohttpinterface = true

to

# Disable the HTTP interface (Defaults to localhost:27018).
nohttpinterface = false

I have searched for days, and there doesn't seem to be anything on the Mongo site about a similar anomaly. If you have encountered a similar issue on Ubuntu Oneiric, please add your comments, even if you haven't found a solution to this issue.

share|improve this question
    
I removed the Ubuntu package (mongodb-server, mongodb-client and dev) apt-get install mongodb-10gen. Then I found this one actually runs on port 28017. The "# Disable the HTTP interface (Defaults to localhost:27018)" comment also does not appear in the 10gen /etc/mongodb.conf file –  Ones and Zeroes Apr 10 '12 at 9:45

1 Answer 1

up vote 1 down vote accepted

First, don't use the Ubuntu packages - you will end up with an old version, in some cases very old (I have seen 1.2, 1.6 etc.). Use the 10gen packages, as of writing this you should get 2.0.4

Next, the HTTP interface defaults to +1000 from whatever your defined MongoDB port is, so if you were expecting it on 27018 then you would have had to set your MongoDB port to 26018. That seems like an odd choice. If you left the port settings as the defaults, then your normal port would be 27017 and the HTTP REST interface would be 28017 - have you mixed them up perhaps?

Finally, if you want to see what is listening on which port, use:

lsof -i | grep LISTEN

That will get you a list of all the open listening ports and their owning processes, add another pipe and grep for mongod to narrow it down even further.

share|improve this answer
    
The Ubuntu package actually has the words "Defaults to localhost:27018" in the /etc/mongodb.conf file. Perhaps its a typo. Whichever however, I agree, the Ubuntu packages are lacking. –  Ones and Zeroes Apr 19 '12 at 8:21
    
that's interesting - I would expect that it's a typo, here's the official one: github.com/mongodb/mongo/blob/master/debian/mongodb.conf –  Adam C Apr 19 '12 at 15:48

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.