# CDC setup in Mongo

## CDC Setup on Linux

1\. Need to set the following in **mongod.conf** configuration file.

```

replSetName: “replica_name”
opLogSizeMB: &lt;integer>
replSetName - You can give any name. Use command rs.status() to get this replica set name.
opLogSizeMB - When you start a replica set member for the first time, MongoDB creates an oplog with a default size. Default size is 5% of physical memory.
Lower bound is 50MB and the upper bound is 50GB. To set this please refer to this 
blog
.
```

* Set the replication name and oplog size
* replSetName: "replica\_name"
* opLogSizeMB: \&lt;integer>
* replSetName - You can give any name. Use command rs.status() to get this replica set name.
* opLogSizeMB - When you start a replica set member for the first time, MongoDB creates an oplog with a default size. Default size is 5% of physical memory.
* Lower bound is 50MB and the upper bound is 50GB. To set this please refer to this [blog](https://docs.mongodb.com/v4.0/core/replica-set-oplog/#oplog-size).

2\. After setting up the above parameters restart the mongoDB.

```
sudo service mongod restart
```

Check the status

```
sudo service mongod status
```

3\. Now initiate the replica set run query

```
rs.initiate({_id: "replica_name", members: [{_id: 0, host: "&lt;host_address>:27017"}]})
```

‍This will return { "ok" : 1 }


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sprinkledata.com/product/ingesting-your-data/pipelines/databases/features/cdc-setup/cdc-setup-in-mongo.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
