MongoDB Connector for BI using compose.io

2k Views Asked by At

im trying to use the MongoDB Connector for BI on my cloud instance which runs on compose.io. This is the command im using:

./mongosqld --mongo-uri mongodb://%host%:%port% --mongo-username %myuser% --mongo-password %mypassword% --auth --mongo-authenticationSource=admin  --mongo-ssl

the connection is setup but i always receive this error message: [schemaDiscovery] unable to initialize schema: no servers available: server selection failed: context deadline exceeded

any idea?

2

There are 2 best solutions below

0
Robert Walters On

If you run into this issue with mongosqld itself try adding "/?connect=direct" to the URI, i.e. "mongosqld --mongo-uri "mongodb://YOUR IP ADDRESS OF MONGODB/?connect=direct". I have a replica set of 1 and ran into that error.

0
bolnad On

I recently ran into a similar issue although the error was slightly different. My error had the same unable to initialize schema but it was an authentication issue

unable to initialize schema: unable to authenticate conversation 0: unable to authenticate using mechanism "SCRAM-SHA-1": (AuthenticationFailed) Authentication failed.

The answer to this is to make sure that your user is added to the admin collection as the authSource defaults to admin. Or you can change the place it looks for the user by adding this flag --mongo-authenticationSource and changing it to the db that has the user.

mongosqld --mongo-uri mongodb://%host%:%port% --mongo-username %myuser% --mongo-password %mypassword% --auth --mongo-authenticationSource=<SOMETHING OTHER THAN ADMIN HERE>  --mongo-ssl

--mongo-authenticationSource <auth-db-name>