0

I am trying to connect to my mongodb deployed in jelastic cloud

If i try to use the test database already provided in the mongodb node in jelastic..it works fine.But if i create my own database and try to access the collections created in it ..i get the following exception

com.mongodb.MongoException: unauthorized db:appdb lock type:-1 client:192.168.1.53

Why is this happening?how can i resolve it?

I am reading the configuration from a file mydb.cfg

host=mongodb-***.jelastic.servint.net
dbname=appdb
user=admin
password=*****

3 Answers3

2

When in Rock Mongo web interface pick the targeted db and go for 'More' in config panel. This has to show you the list of users having rights for DB. enter image description here

  • there was only the admin user for test database and no user specified for the databases created by me.Should i add any user to those databases in order to access them through java? – user1911867 Dec 22 '12 at 06:36
  • Yep. Try to add 'admin' user to your DB in case you are connecting with the code provided earlier. This should work. –  Dec 22 '12 at 11:20
  • the same exception there after adding db user? –  Dec 22 '12 at 14:26
0

Did you set the user and rights for your custom collection? Try to check the configuration under 'Authentication' section?

Anyway, supposedly admin user should have rights to all DBs. You can try to figure this issue out at Jelastic community

0

I had the same issue when connection to mongodb custom named database. In order to succeed with the connection, I have created an user for my custom named database. (I added the provided admin user with its password to the authorized users as the image shown).

florins
  • 1,605
  • 1
  • 17
  • 33