MongoDB.live, free & fully virtual. Register Now MongoDB.live, free & fully virtual. Register Now

MongoSQLd connection not working from Tableau Server

Hi,

I have set up a Tableau Server (2019.3) for production in Linux (Ubuntu 18.04). My database is MongoDB Enterprise 4.0.19, and so I use MongoDB BI connector to connect to it.

I have installed the MYSQL ODBC connector (mysql-connector-odbc-5.3.13) , MongoDB ODBC connector (mongodb-connector-odbc-1.2.0), MongoBI connector (mongodb-bi-linux-x86_64-ubuntu1604-v2.12.0)

My MongoDB uses a normal authentication with a username & password without SSL.

The following command created a ‘.drdl’ file for the schema

mongodrdl --host=*.*.*.*** --port=27017 --db=**** --out=outffile.drdl --username=username --password=pass --authenticationDatabase=authdb --authenticationMechanism=SCRAM-SHA-1

I started the MongoSQLd service using the following command:

mongosqld --addr *.*.*.***:3307 --mongo-uri=mongodb://*.*.*.***:27017 --sslMode=disabled --mongo-username=username --mongo-password "pass" --auth --mongo-authenticationSource=authdb --schema path_to_drdl_file -vv

The connection works fine with Tableau Desktop application but fails when connecting from Tableau Server to MongoDB (for refreshing extracts).

Screenshot attached from Tableau Server when I try to test connection

renditionDownload

Below screenshot is the log of MongoSQLd service


NOTE: It works fine if I disable the MongoDB authentication. But authentication is a requirement.

Then I configured SSL for BI Connector as given in MongoDB documentation

[https://docs.mongodb.com/bi-connector/v2.12/tutorial/ssl-setup](http://mongo --ssl --host reizend100 --sslCAFile /opt/certs/mdbca.crt --sslPEMKeyFile /opt/certs/mdb.pem)
and I have edited the mongosqld.conf and mongod.conf but when testing the connection with mongo shell
it got connected successfully

mongo --ssl --host mongodb.localhost --sslCAFile /opt/certs/mdbca.crt --sslPEMKeyFile /opt/certs/mdb.pem -u “admin” -p “abcd” --authenticationDatabase “admin”

But when connected to mongosqld instance using the command:
mysql --ssl-mode REQUIRED --ssl-ca=/opt/certs/mdbca.crt --enable-cleartext-plugin --port 3307 -u <username> -p

It didn’t show the DB in that.
and the mongosqld log at this time:

Mongod.conf

storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true

systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

net:
  port: 27017
  bindIp: 127.0.0.1
  ssl:
      mode: requireSSL
      PEMKeyFile: '/opt/certs/mdb.pem'
      CAFile: '/opt/certs/mdbca.crt'
      clusterFile: '/opt/certs/mdb.pem'

# how the process runs
processManagement:
  timeZoneInfo: /usr/share/zoneinfo

security:
  clusterAuthMode: x509

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options:

#auditLog:

Mongosqld.cong

systemLog:
  logAppend: true
  path: "/var/log/mongodb/mongosqld.log"
  verbosity: 2

security:
  enabled: true

mongodb:
  net:
    uri: "mongodb://127.0.0.1:27017"
    auth:
      username: "user2"
      password: "user2"
    ssl:
      enabled: true
      PEMKeyFile: '/opt/certs/mdb.pem'
      CAFile: '/opt/certs/mdbca.crt'

net:
  bindIp: 0.0.0.0
  port: 3307
  ssl:
    mode: "requireSSL"
    PEMKeyFile: "/opt/certs/mdb.pem"
    CAFile: "/opt/certs/mdbca.crt"

schema:
#  path : "/home/reizend100/tableau/mongo-odbc-driver/iqraa_analytics11.drdl"
  sample:
    namespaces: "iqraa_analytics.*"

processManagement:
  service:
    name: mongosqld
    displayName: mongosqld
    description: "BI Connector SQL proxy server"

The user2 has the privilege “find”, “listCollections”

I have tried with another user which has “readAnyDatabase” but still not connected from the tableau server

What am I missing?

This Issues occur when we have authentication in MongoDB and work fine when we disable the Mongodb authentication