MongoDB db.serverStatus() gives error when running using tunnel that is targetted to api.cloudfoundry.com

Posted by Ajay on Stack Overflow See other posts from Stack Overflow or by Ajay
Published on 2012-09-10T15:37:00Z Indexed on 2012/09/10 15:37 UTC
Read the original article Hit count: 232

Filed under:
|
|

Following is the console session...

C:\Users\xxx>vmc tunnel myMongoDB
Getting tunnel connection info: OK

Service connection info:
  username : uuuu
  password : pppp
  name     : db
  url      : mongodb://uuuu:[email protected]:25200/db

Starting tunnel to myMongoDB on port 10000.
1: none
2: mongo
3: mongodump
4: mongorestore
Which client would you like to start?: 2
Launching 'mongo --host localhost --port 10000 -u uuuu -p pppp db'

MongoDB shell version: 2.0.6
connecting to: localhost:10000/db
> db.serverStatus()
{ "errmsg" : "need to login", "ok" : 0 }
>

Which credentials should I use to login (assuming should use db.auth) to get rid of the error "{ "errmsg" : "need to login", "ok" : 0 }".

When I run the same in micro CF on my machine it works ok and gives me the expected output.

P.S. I'm trying this to get to know the current connections on my application, written in node.js. Trying to debug some issues with connections to the DB. If there is any other alternative that I can use please suggest that as well.

© Stack Overflow or respective owner

Related posts about mongodb

Related posts about cloudfoundry