Connect MongoDB to Infograph
What it brings in: Every collection the user can read.
What you need
- A MongoDB database that accepts connections from the internet, or an SSH server that can reach it. On MongoDB Atlas, follow the MongoDB Atlas guide instead.
- Permission to create a database user, and to change who can connect: your firewall, your host's IP allowlist or net.bindIp.
- 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://[USER]user: fix for "The username or password was not accepted.":[PASSWORD]password: fix for "The username or password was not accepted."@[CLUSTER].mongodb.nethost: fix for "We couldn't find that host. Check the host name, then try again."/[DATABASE]database: fix for "That database does not exist on this server."Steps
Allow Infograph through your firewall
Allow the addresses below on MongoDB's port, usually 27017. On your own server, also check net.bindIp in mongod.conf includes a public interface. On a hosted service, add them to its IP allowlist.
51.222.152.247/32Create a read-only user
Infograph only reads. Give it its own user with the read role on your database. Run this in mongosh as an admin, with your own password and database name.
use admin db.createUser({ user: "infograph", pwd: "[strong-password]", roles: [ { role: "read", db: "[database]" } ] })Paste your connection string, or enter the details
Open MongoDB in Infograph and paste your mongodb:// or mongodb+srv:// string into Connection string. Infograph fills in the details from it. Or press Enter manually: set Connection type to Standard (mongodb://) for one server's host and port, or DNS seed list (mongodb+srv://) for a host that names its servers in DNS, which takes no port. Fill in Database, Username and Password, and set Authentication database to admin when the user was created there, as the one above was.
Allow 51.222.152.247 through your firewall so Infograph can connect.
ConnectConnect and choose your collections
If your server accepts only encrypted connections, turn on Encrypt the connection (TLS) under Advanced. It shows for a Standard (mongodb://) address; a DNS seed list is always encrypted. Press Connect, pick the collections you want and Infograph starts loading them.
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 address is private, such as localhost, 10.x or 192.168.x, so only your own network can reach it. Use the database's public address, or connect through an SSH server under Advanced.
We couldn't find that host. Check the host name, then try again.
The host name does not resolve. Copy it again from your provider, without mongodb:// or mongodb+srv:// and without a port, and check it is the public address rather than an internal one. With Connection type set to DNS seed list (mongodb+srv://), the host must name its servers in DNS; for one server's name, choose Standard (mongodb://).
The host refused the connection. Check the port, and that your database accepts connections from Infograph's address.
The server answered but nothing accepted the connection on that port. Check the port, and that MongoDB listens on a public interface (net.bindIp in mongod.conf, which is localhost only by default).
The server closed the connection. Check that it allows Infograph's address, and whether it requires an encrypted connection.
Usually encryption. A server that accepts only encrypted connections hangs up on one without it: turn on Encrypt the connection (TLS) under Advanced. Otherwise check the server allows 51.222.152.247.
The host did not answer in time. Check the host and port, and that your firewall allows Infograph's address.
Usually a firewall dropping the connection. Allow 51.222.152.247 on your database's port, or add them to your host's IP allowlist. If the database is on a private network, connect through an SSH server under Advanced.
The username or password was not accepted.
Check the username and password, and that the user exists on this server. In a pasted string, characters such as @,
Those credentials were not accepted.
MongoDB reports most sign-in failures this way. Check the username and password, then Authentication database: it must name the database the user was created in, and users made with use admin need admin. Leave it blank only if the user was created in the database you are connecting to.
That database does not exist on this server.
Check Database names the database that holds your collections. In a pasted string it is the part after the host and /. It is not the Authentication database, which only says where the user was created.
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's spelling and case, for example with show dbs in mongosh.
Through an SSH server
Infograph could not reach your SSH server. Check its address and port, and that it allows connections from Infograph's address.
Check the SSH server's public address and port, and that its firewall allows 51.222.152.247 on that port, usually 22.
Your SSH server only offers old encryption settings. Infograph needs a current OpenSSH with an Ed25519, ECDSA or RSA (SHA-2) host key.
Your SSH server only offers old encryption settings. Update OpenSSH on it. It needs an Ed25519, ECDSA or RSA (SHA-2) host key.
Your SSH server refused Infograph's key. Check the key is in authorized_keys for that user.
Add Infograph's public key, shown in the form when you turn on SSH, to ~/.ssh/authorized_keys for the SSH user you entered. Check that user exists and that the file is readable only by them.
Your SSH server's identity changed. If you expected this, trust the new server on the connection.
Infograph remembers your SSH server's key from the first connect, and the server now shows a different one. If you rebuilt or replaced the server, open the connection and press Trust the new server. If you did not, ask whoever runs the server before you trust it.
This connection has not trusted an SSH server yet. Open the connection and use Re-discover streams to trust it.
The connection has not checked your SSH server yet. Open the connection and press Re-discover streams. Infograph then remembers the server's key.
Your SSH server would not forward to the database host. Check the permitopen rule and the database host and port.
The SSH server would not pass the connection on to the database. In authorized_keys, the permitopen rule must name the database host and port exactly as you entered them. In sshd_config, AllowTcpForwarding must not be no. The database must also accept connections from the SSH server, for example in its firewall or net.bindIp.
Common problems
These happen in MongoDB itself, where Infograph cannot see them.
The SSH switch is missing
Connect through an SSH server, under Advanced, shows only when Connection type is Standard (mongodb://). A DNS seed list names several servers, and a tunnel carries one, so enter the host and port of one server the SSH server can reach.
A string with several hosts is refused
Infograph connects to one server's address, or to a mongodb+srv:// seed list. Paste the mongodb+srv:// string if your host gives one, or enter one server's host and port.
A collection is missing from the list
Infograph lists the collections in the database you entered. Views and system collections are not listed. If the list is empty, check the database name, and that the user's read role is on that database rather than another one.