You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Shanker Sneh <sh...@zoomcar.com> on 2019/03/13 08:09:43 UTC
getMongo _ Unable to connect
Dear users,
I am facing strange connectivity issues while getting to work with
getMongo.
And the interesting part is - I am able to use the same Mongo credentials
to *successfully* login via command shell. And *also* MongoDB Compass
workbench is able to connect too.
For example, this thing works:
~/Downloads/mongodb-osx-x86_64-4.0.0/bin/mongo -u nifi_dl -p PASSWORD
192.168.2.199:27017/prod-payments
I have been stuck with this for quite sometime.
Please help! Below are the 2 screenshots.
[image: Screenshot 2019-03-13 at 13.25.30.png]
[image: Screenshot 2019-03-13 at 13.29.44.png]
--
Best,
Sneh
Re: getMongo _ Unable to connect
Posted by Shanker Sneh <sh...@zoomcar.com>.
Thanks a lot Kevin for spending time to look at my issue!
Yes, you are right. /database-name is the authentication source for use
credentials. And in my case "prod-payments" is the only database, which is
used for authenticating as well.
Below is screenshot from the workbench. And from the terminal as well (*both
work*).
I actually have a good-sized production NiFi cluster running with some 20+
different processors (I am not a total newbie with NiFi).
But I am quite surprised to not being able to get a simple Mongo connector
to work. :(
Request some guidance.
[image: Screenshot 2019-03-13 at 19.05.25.png]
[image: Screenshot 2019-03-13 at 19.08.25.png]
On Wed, Mar 13, 2019 at 6:38 PM Kevin Doran <kd...@apache.org> wrote:
> Sneh,
>
> I suspect it is because the authentication source database you specify in
> your mongo connection string is incorrect.
>
> Looking at [1][2] the database specified by /database-name is the
> authentication source for the user credentials, not the database to use for
> queries:
> /database Optional. The name of the database to authenticate if the
> connection string includes authentication credentials in the form of
> username:password@. If /database is not specified and the connection
> string includes credentials, the driver will authenticate to the admin database.
> See also authSource
> <https://docs.mongodb.com/manual/reference/connection-string/#urioption.authSource>
> .
> Note this is different from the mongo shell which would use
> --authenticationDatabase or ?authSource to specify the authentication
> source database [3]. I suspect that is why a shell login is working.
>
> If you authenticate with the default "admin" database, just remove the
> "/prod-payments" part of your mongo connection url
>
> Hope this helps,
> Kevin
>
>
> [1] https://docs.mongodb.com/manual/reference/connection-string/
> [2]
> https://docs.mongodb.com/manual/reference/connection-string/#connections-connection-options
> [3] https://docs.mongodb.com/manual/mongo/
>
> On Wed, Mar 13, 2019 at 4:10 AM Shanker Sneh <sh...@zoomcar.com>
> wrote:
>
>> Dear users,
>>
>> I am facing strange connectivity issues while getting to work with
>> getMongo.
>>
>> And the interesting part is - I am able to use the same Mongo credentials
>> to *successfully* login via command shell. And *also* MongoDB Compass
>> workbench is able to connect too.
>> For example, this thing works:
>> ~/Downloads/mongodb-osx-x86_64-4.0.0/bin/mongo -u nifi_dl -p PASSWORD
>> 192.168.2.199:27017/prod-payments
>>
>> I have been stuck with this for quite sometime.
>> Please help! Below are the 2 screenshots.
>>
>>
>>
>> [image: Screenshot 2019-03-13 at 13.25.30.png]
>>
>>
>> [image: Screenshot 2019-03-13 at 13.29.44.png]
>> --
>> Best,
>> Sneh
>>
>
--
Best,
Sneh
Re: getMongo _ Unable to connect
Posted by Kevin Doran <kd...@apache.org>.
Sneh,
I suspect it is because the authentication source database you specify in
your mongo connection string is incorrect.
Looking at [1][2] the database specified by /database-name is the
authentication source for the user credentials, not the database to use for
queries:
/database Optional. The name of the database to authenticate if the
connection string includes authentication credentials in the form of
username:password@. If /database is not specified and the connection string
includes credentials, the driver will authenticate to the admin database.
See also authSource
<https://docs.mongodb.com/manual/reference/connection-string/#urioption.authSource>
.
Note this is different from the mongo shell which would use
--authenticationDatabase or ?authSource to specify the authentication
source database [3]. I suspect that is why a shell login is working.
If you authenticate with the default "admin" database, just remove the
"/prod-payments" part of your mongo connection url
Hope this helps,
Kevin
[1] https://docs.mongodb.com/manual/reference/connection-string/
[2]
https://docs.mongodb.com/manual/reference/connection-string/#connections-connection-options
[3] https://docs.mongodb.com/manual/mongo/
On Wed, Mar 13, 2019 at 4:10 AM Shanker Sneh <sh...@zoomcar.com>
wrote:
> Dear users,
>
> I am facing strange connectivity issues while getting to work with
> getMongo.
>
> And the interesting part is - I am able to use the same Mongo credentials
> to *successfully* login via command shell. And *also* MongoDB Compass
> workbench is able to connect too.
> For example, this thing works:
> ~/Downloads/mongodb-osx-x86_64-4.0.0/bin/mongo -u nifi_dl -p PASSWORD
> 192.168.2.199:27017/prod-payments
>
> I have been stuck with this for quite sometime.
> Please help! Below are the 2 screenshots.
>
>
>
> [image: Screenshot 2019-03-13 at 13.25.30.png]
>
>
> [image: Screenshot 2019-03-13 at 13.29.44.png]
> --
> Best,
> Sneh
>