MongoDB
In this section, we will go over how to gather your credentials and prepare your MongoDB server to start providing CDC logs.
Introduction
We will be running Debezium to fetch CDC logs from MongoDB by using Change Streams which is a more performant and reliable approach than tailing the oplog
.
MongoDB server must be in a replica set. If your deployment only has a standalone
server, you can create a replica set with one member.
Need help? Check out this guide.
Finding your MongoDB settings
This is necessary so that we are able to run a Debezium deployment to subscribe to Change Events within your MongoDB cluster. To see additional configuration properties, please click here to see Debezium's documentation.
Creating a service account
You can either use the Atlas UI or use MongoDB CLI.
Option #1 - Atlas UI
Click on "Database Access" on the left
Click on "Add New Database User"
Under "Database User Privileges", open "Built-in Role" and Select "Only read any database"
Option #2 - Service account script
Connection string
Go to Atlas UI
Find your deployment and click "Connect"
We support both MongoDB SRV format or standard connection string.
Supported types
Types are sourced from the MongoDB extended JSON specification.
Array
Binary
Array
Boolean
ObjectID
Int32
Int64
Double
Decimal128
Code
CodeWScope
RegEx
Datetime
Timestamp
String
Running it yourself
Self-hosted notes:
value.converter
must be set toorg.apache.kafka.connect.json.JsonConverter
value.converter.schemas.enable
must be set totrue
Last updated