Navigation
This version of the documentation is archived and no longer supported.

Using the MongoDB Connector for BI with Atlas

On this page

Atlas is a cloud service for running, monitoring, and maintaining MongoDB deployments, including the provisioning of dedicated servers for the MongoDB instances.

Atlas uses TLS/SSL to encrypt connections and enforces authentication by default. This page explains how to connect to Atlas using the MongoDB Connector for BI.

Note

With the MongoDB Atlas free tier, MongoDB Connector for BI cannot run aggregation pipelines using the allowDiskUse option. This option allows aggregation stages to write data as temporary files to disk. To review the MongoDB Atlas free tier constraints, see the MongoDB Atlas manual.

mongodrdl

To create a DRDL file from an Atlas database, use the following command format:

mongodrdl --host <domain0>.mongodb.net:27017,<domain1>.mongodb.net:27017,... -u <username> -p <password> --ssl --authenticationDatabase=admin -d <database>

For more information, see mongodrdl.

mongosqld

To connect mongosqld to an Atlas cluster, you must provide a .pem key file.

mongosqld can use any valid TLS certificate issued by a certificate authority, or a self-signed certificate. If you use a self-signed certificate, although the communications channel will be encrypted, there will be no validation of server identity. Although such a situation will prevent eavesdropping on the connection, it leaves you vulnerable to a man-in-the-middle attack. Using a certificate signed by a trusted certificate authority will permit your MySQL client to verify the server’s identity.

For testing purposes, you can create a .pem key file named test.pem using the openssl tool:

openssl req -nodes -newkey rsa:2048 -keyout test.key -out test.crt -x509 -days 365 -subj "/C=US/ST=test/L=test/O=test Security/OU=IT Department/CN=test.com"
cat test.crt test.key > test.pem

Start mongosqld with the --auth and --sslPEMKeyFile options.

If you named your key file test.pem as in the previous example, you can run the following, substituting your schema file and cluster URI:

Note

Do not specify a username and password in --mongo-uri. The connection string should only contain the list of servers.

mongosqld --mongo-ssl --auth --sslPEMKeyFile test.pem --schema <schema.drdl> --mongo-uri <uri>

Pass your username, password, and authentication database to your SQL client. For example, using mysql without verifying your mongosqld server certificate:

mysql --host <mongosqld-host> --port <mongosqld-port> -u <username>?source=admin -p --ssl-mode required --enable-cleartext-plugin

Refer to Connect with the MySQL Client for more details on using the mysql client with the MongoDB Connector for BI.