I have a 3 node replicaset setup
Both have private connectivity with each other and resides on same DC (DataCenter1)
- 10.1.0.1 - Primary
- 10.1.0.2 - Secondary
We are planning to have another node which resides on another DC (DataCenter2)
- 11.1.0.1 - Secondary (For DR Purposes) Public IP: 20.20.20.20
but that node would not have a private connection with the other nodes. How can I achieve this? I tried adding the 3rd Node’s Public IP in the replicaset however it is not syncing properly
Basically my rs.conf() is this
members: [
{
_id: 0,
host: ‘10.1.0.1:27017’,
arbiterOnly: false,
buildIndexes: true,
hidden: false,
priority: 10,
tags: {},
secondaryDelaySecs: Long(‘0’),
votes: 1
},
{
_id: 1,
host: ‘10.1.0.2:27017’,
arbiterOnly: false,
buildIndexes: true,
hidden: false,
priority: 5,
tags: {},
secondaryDelaySecs: Long(‘0’),
votes: 1
},
{
_id: 2,
host: ‘20.20.20.20:27017’,
arbiterOnly: false,
buildIndexes: true,
hidden: false,
priority: 0,
tags: {},
secondaryDelaySecs: Long(‘0’),
votes: 1
}
The 3rd node is stuck at STARTUP and its log is stuck at connecting
{“t”:{“$date”:“2024-05-09T09:37:16.624+00:00”},“s”:“I”, “c”:“CONNPOOL”, “id”:22576, “ctx”:“ReplNetwork”,“msg”:“Connecting”,“attr”:{“hostAndPort”:“10.1.0.1:27017”}}