Connect to MongoDB
Learn to create a connection to MongoDB to use as a source or target for OCI GoldenGate.
Before you begin
- Review how OCI GoldenGate connects to your source and targets.
- Configure the required policies to enable secure Vault and Secrets access, such as use secrets, use vaults, and read secret-bundles. For more information, see Minimum recommended policies.
- Configure a MongoDB replicat set:
- OCI GoldenGate for Big Data uses the operations log (oplog) to read Change Data Capture (CDC) records. The oplog is a capped collection in MongoDB that maintains a rolling record of all operations that modify the database. Oplog files are created when a replica set is enabled in MongoDB.
- MongoDB Atlas comes preconfigured with a Replicat set. For on-premises MongoDB deployments, you must manually configure and deploy a Replicat set to enable oplog and CDC functionality. For on premises MongoDB, you need to deploy a Replica set.
- Have MongoDB version 3.6 or later.
- Have OCI GoldenGate support to capture the following operations:
INSERT,UPDATE,DELETE.
Create the connection
Known issues
OCI GoldenGate MongoDB connection doesn't support mongdb+srv connection strings.
Workaround: Use MongoDB connection strings.
- In MongoDB Atlas, click Connect.
- Select Drivers.
- Select Java.
- For Version, select 3.4 or later.
- You can use the provided mongodb string. For
example:
mongodb://<user_name>:<db_password>@cluster0-shard-00-00.abc.mongodb.net:27017,cluster0-shard-00-01.abc.mongodb.net:27017,cluster0-shard-00-02.abc.mongodb.net:27017/?ssl=true&replicaSet=atlas-3grqh1-shard-0&authSource=admin&retryWrites=true&w=majority&appName=Cluster0
Issue with MongoDB Test connection
You may encounter an error when using Test connection with MongoDB connections. You can ignore this error and test MongoDB connections in the OCI GoldenGate deployment console. In the deployment console, open the navigation menu for the Administration Service, click Configuration. Your MongoDB connection should be listed as a credential, where you can click Connect to <alias> to test the connection.