"The $changeStream stage is only supported on replica sets" error while using mongodb-source-connect
stage is only supported on replica sets
You need to make your Mongo database a replica set in order to read the oplog
https://dba.stackexchange.com/questions/243780/converting-mongodb-instance-from-standalone-to-replica-set-and-backing-up
MongoDB change streams option is available only in replica sets setup. However, you can update your standalone installation to a single node replica set by following the below steps.
- Locate the
mongodb.conf
file and add the replica set details
Add the following replica set details to mongodb.conf
file
replication: replSetName: "<replica-set name>"
Example
replication: replSetName: "rs0"
Note: Location in brew installed MongoDB /usr/local/etc/mongod.conf
- Initiate the replica set using
rs.initiate()
Login to the MongoDB shell and run command rs.initiate()
this will start your replica set. Logs look like the following on successful start
> rs.initiate()
{
"info2" : "no configuration specified. Using a default configuration for the set",
"me" : "127.0.0.1:27017",
"ok" : 1,
"$clusterTime" : {
"clusterTime" : Timestamp(1577545731, 1),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
},
"operationTime" : Timestamp(1577545731, 1)
}
That's all with these two simple steps you are running a MongoDB replica set with one node only.
Reference: https://onecompiler.com/posts/3vchuyxuh/enabling-replica-set-in-mongodb-with-just-one-node