Configuring MongoDB Atlas as a Source
ON THIS PAGE
After you have selected MongoDB Atlas as the Source for creating the Pipeline, provide the connection settings and data replication details listed here in the Configure Your Source page. You can fetch the database settings from your MongoDB Atlas account.
- Database settings of your MongoDB Atlas account are available.
- Hevo has permissions to read your MongoDB Atlas databases.
- Hevo’s IP addresses have access permissions on your SSH server.
Configuring MongoDB Atlas Settings in Hevo
Provide the following information in the Configure Your Source page during Pipeline creation:
Pipeline Name: A unique name for the Pipeline.
Provide the following database settings fetched from the MongoDB Atlas account:
Database Host: The MongoDB DNS name fetched from your MongoDB Atlas account. No additional information needs to be provided in this field irrespective of your MongoDB configuration.
Database User: The authenticated user that can read the collections in your database. Read Setting up Permissions to Read MongoDB Atlas Databases
Note: It is recommended that only
read-onlypermissions be provided to the user.
Database Password: The password for the database user.
- Connect through SSH: Enable this toggle option to connect to Hevo using an SSH tunnel, instead of directly connecting your MongoDB Atlas database host to Hevo. This provides an additional level of security by not exposing your MongoDB setup to the public. Read Connecting Through SSH.
If this option is disabled, you must whitelist Hevo’s IP addresses to allow Hevo to connect to your MongoDB host.
Load All Databases: If enabled, Hevo fetches data from all your databases on the selected host. If disabled, provide the Database Name to fetch data from.
Note: You can separate multiple database names with a comma.
Merge Collections: If enabled, collections with the same name across different databases are merged into a single Destination table. If disabled, separate tables are created, prefixed with the respective database name. See Example - Merge Collections Feature.
Load Historical Data: If disabled, Hevo loads data written in your database after the time of creation of the Pipeline. If enabled, the entire table data is fetched during the first run of the Pipeline.
Setting up Permissions to Read MongoDB Atlas Databases
Whether you have selected OpLog or Change Streams as the Pipeline mode, you need to assign the required permissions to the different databases for the Hevo user to be able to read from these, as follows:
- In your MongoDB Atlas console, click Database Access, and then, Add New Database User.
- Select the Authentication Method as Password.
- In the Password Authentication section, provide a username and password for the new user. You can skip this if you are editing an existing user.
- In the Database User Privileges drop-down, select Grant Specific Privileges from the Advanced Privileges list.
- Grant the following access privileges. Click + Add Another Role to set up access for multiple databases.
readaccess to the local database.
readaccess to the databases you want to replicate.
readAnyDatabaseaccess to the
admindatabase if you want to load all databases.
Retrieving Database Settings from MongoDB Atlas
Perform the following steps to retrieve your MongoDB Atlas database settings:
Access the MongoDB Atlas console and select the project whose data you want to replicate.
Click Clusters in the left navigation bar.
Connect with the mongo shell.
Ensure that the
mongo shell versionis greater than 3.6, and click COPY to copy the connection string.
Copy the database host name and the user name.
Whitelisting Hevo’s IP Address in MongoDB Atlas
Access your MongoDB Atlas console and:
- Click Network Access.
In the IP Whitelist tab, click Add IP Address.
- Provide the Hevo IP address you want to whitelist.
Note: To provide all IPs with access, enter 0.0.0.0.