Connect MongoDB Atlas to Infograph
What it brings in: Every collection the user can read.
What you need
- A MongoDB Atlas cluster, and the Project Owner role in its project, or roles that let you add database users and IP access list entries.
- A database user with a password. Infograph signs in with a username and password, not with X.509 certificates or AWS IAM.
- Infograph's sync servers connect from 51.222.152.247.
Your connection string
Each part is one thing you fill in, and each can fail on its own.
mongodb+srv://[username]user: fix for "The username or password was not accepted.":[password]password: fix for "The username or password was not accepted."@[cluster].[id].mongodb.nethost: fix for "We couldn't find that host. Check the host name, then try again."/?retryWrites=true&w=majoritySteps
Add Infograph to the IP Access List
In Atlas, click Database & Network Access under Security in the sidebar, then IP Access List. For each address below, click Add IP Address, enter it and click Confirm.
51.222.152.247/32Create a read-only database user
Infograph only reads. On the same page, open the Database Users tab and click Add New Database User. Choose Password, enter infograph and a strong password. Under Specific Privileges, add read on the database you want to sync, or choose the built-in role that reads any database (readAnyDatabase). Click Add User.
Copy the connection string
Click Clusters under Database in the sidebar, click Connect on your cluster and choose Drivers. Copy the mongodb+srv:// string. Leave SRV Connection String on: Free and Flex clusters only work with this form.
mongodb+srv://[username]:[password]@[cluster].[id].mongodb.net/?retryWrites=true&w=majorityPaste it in Infograph and choose your collections
Open MongoDB Atlas in Infograph and paste the string into Connection string, with your user's password in place of <db_password>. Atlas's string names no database, so press Enter manually and type yours into Database. Leave Authentication database blank or set it to admin, where Atlas keeps its database users. Press Connect, pick the collections you want and Infograph starts loading them.
Allow 51.222.152.247 through your firewall so Infograph can connect.
Connect
Troubleshooting
Each entry is the message Infograph shows when a connection fails. Open it for the fix.
This host is not reachable from Infograph. Use your database's public address.
The host resolves to a private address. A private endpoint address (it contains -pl-) or a peering address works only inside your cloud network. Copy the standard string from Connect, Drivers instead.
We couldn't find that host. Check the host name, then try again.
Copy the string again from Connect, Drivers rather than typing the host. With Connection type set to DNS seed list (mongodb+srv://), the host is the cluster's own name, such as cluster0.ab1cd.mongodb.net, not one server's address.
The host refused the connection. Check the port, and that your database accepts connections from Infograph's address.
Set Connection type to DNS seed list (mongodb+srv://) and paste the string from Connect, Drivers again. Atlas names its servers through that seed list, so one server's address and port is rarely what you want.
The server closed the connection. Check that it allows Infograph's address, and whether it requires an encrypted connection.
Usually the IP Access List: check 51.222.152.247 are on it and show Active. On a Free or Flex cluster, also check Connection type is DNS seed list (mongodb+srv://), the only form those clusters accept from Infograph.
The host did not answer in time. Check the host and port, and that your firewall allows Infograph's address.
Usually the IP Access List. Add 51.222.152.247 under Database & Network Access, IP Access List, and wait for each entry to show Active. Check the cluster is not paused.
The username or password was not accepted.
Use the database user's password, not your Atlas login: database users are separate, and listed on the Database Users tab. Replace <db_password> in the string. In a string, characters such as @, # or / must be percent-encoded, so @ becomes %40. Or enter the password in Password instead.
Those credentials were not accepted.
Check the user is on the Database Users tab and may use this cluster: a user restricted to specific clusters cannot sign in to the others. Leave Authentication database blank or set it to admin.
That database does not exist on this server.
Atlas's string names no database, so Infograph uses the name in Database. Check it is the database that holds your collections, not the cluster's name.
We found nothing to sync in this database. Check the database name.
Infograph connected but found no collections in that database. MongoDB does not report a misspelled database, it shows an empty one, so check the name in Database matches, in spelling and case, a database Atlas lists for the cluster.
Common problems
These happen in MongoDB Atlas itself, where Infograph cannot see them.
A large collection loads slowly on a Free cluster
Atlas limits how many operations a Free cluster handles each second and how much data it sends each week, so reading a big collection takes longer there. A Flex or dedicated cluster does not have those limits.