You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Wang Darrell <da...@gmail.com> on 2015/03/31 11:24:38 UTC

mongodb authentication problem

Is there anyone who tried to connect drill to mongodb with --auth.

When I started my mongo with auth.
drill can't do any query.

My mongodb version is 2.6.9

here is the mongodb admin user information

db.createUser({
 user:"test",
pwd :"test",
roles:[{
role : "readAnyDatabase" , db:"admin"
}]

})

I just want the user can query data that just need "read" permission.

here is the drill storage config

{
  "type": "mongo",
  "connection":"mongodb://test:test@192.168.170.136:27017/",
  "enabled": true
}

Then it just keep return this error
CommandFailureException: { "serverUsed" : "192.168.170.136:27017" , "ok" :
0.0 , "errmsg" : "not authorized on admin to execute command {
listDatabases: 1 }"

don't know where is the problem. I tried mongo shell and robomongo , they
all can login with this account and query the data.

I find a similar problem with this
https://issues.apache.org/jira/browse/DRILL-1502?jql=text%20~%20%22mongo%20auth%22

Is the mongo user permission went wrong ?

Re: mongodb authentication problem

Posted by Andries Engelbrecht <ae...@maprtech.com>.
See the following links.

http://drill.apache.org/blog/2014/11/19/sql-on-mongodb/

https://issues.apache.org/jira/browse/DRILL-1502

—Andries


On Mar 31, 2015, at 2:24 AM, Wang Darrell <da...@gmail.com> wrote:

> Is there anyone who tried to connect drill to mongodb with --auth.
> 
> When I started my mongo with auth.
> drill can't do any query.
> 
> My mongodb version is 2.6.9
> 
> here is the mongodb admin user information
> 
> db.createUser({
> user:"test",
> pwd :"test",
> roles:[{
> role : "readAnyDatabase" , db:"admin"
> }]
> 
> })
> 
> I just want the user can query data that just need "read" permission.
> 
> here is the drill storage config
> 
> {
>  "type": "mongo",
>  "connection":"mongodb://test:test@192.168.170.136:27017/",
>  "enabled": true
> }
> 
> Then it just keep return this error
> CommandFailureException: { "serverUsed" : "192.168.170.136:27017" , "ok" :
> 0.0 , "errmsg" : "not authorized on admin to execute command {
> listDatabases: 1 }"
> 
> don't know where is the problem. I tried mongo shell and robomongo , they
> all can login with this account and query the data.
> 
> I find a similar problem with this
> https://issues.apache.org/jira/browse/DRILL-1502?jql=text%20~%20%22mongo%20auth%22
> 
> Is the mongo user permission went wrong ?