Description
I have been ordered by the boss of Team Rocket to implement redundancy for MongoDB used in Rocket.Chat.
I set up MongoDB with a Primary, Secondary, and Arbiter configuration, but when the Primary goes down, my message inputs get grayed out, and the messages I send are not visible to other users.I have confirmed that setting up two Secondaries along with the Primary solves the issue.I believe this is due to the behavior of MongoDB’s ChangeStream API.
If you have any knowledge on how to configure MongoDB so that Rocket.Chat works with a Primary, Secondary, and Arbiter setup, I would greatly appreciate your advice.
Server Setup Information
- Version of Rocket.Chat Server: 6.5.2
- Operating System: Red Hat Enterprise Linux 8.8
- Deployment Method: tar
- Number of Running Instances: 2
- DB Replicaset Oplog: true
- NodeJS Version: 14.21.3
- MongoDB Version: 5.0.21
- Proxy: nginx
- Firewalls involved:
Any additional Information
This is the configuration information for the replica set.
{
"_id" : "chat",
"version" : 9,
"term" : 61,
"members" : [
{
"_id" : 0,
"host" : "192.168.21.203:27017",
"arbiterOnly" : false,
"buildIndexes" : true,
"hidden" : false,
"priority" : 2,
"tags" : {
},
"secondaryDelaySecs" : NumberLong(0),
"votes" : 1
},
{
"_id" : 1,
"host" : "192.168.21.204:27017",
"arbiterOnly" : false,
"buildIndexes" : true,
"hidden" : false,
"priority" : 1,
"tags" : {
},
"secondaryDelaySecs" : NumberLong(0),
"votes" : 1
},
{
"_id" : 2,
"host" : "192.168.21.248:27017",
"arbiterOnly" : true,
"buildIndexes" : true,
"hidden" : false,
"priority" : 0,
"tags" : {
},
"secondaryDelaySecs" : NumberLong(0),
"votes" : 1
}
],
"protocolVersion" : NumberLong(1),
"writeConcernMajorityJournalDefault" : true,
"settings" : {
"chainingAllowed" : true,
"heartbeatIntervalMillis" : 2000,
"heartbeatTimeoutSecs" : 10,
"electionTimeoutMillis" : 10000,
"catchUpTimeoutMillis" : -1,
"catchUpTakeoverDelayMillis" : 30000,
"getLastErrorModes" : {
},
"getLastErrorDefaults" : {
"w" : 1,
"wtimeout" : 0
},
"replicaSetId" : ObjectId("667d056118c880954dc247a5")
}
}