0

I am trying to set up multiple RocketChat servers each with their own databases. As Rocketchat Depends on MongoDB, according to my limited knowledge, each mongod replicaset can only serve 1 Rocket Chat instance at one time. Is it possible to have multiple replicasets per server? I think the right term of what I am trying to achieve is multi-tenancy. Is it possible?

Thank you!

1 Answers1

0

Mongo supports multiple databases. So simple answer is yes you can have multiple Rocket.Chat servers per replicaset.

Mongo replicaset is a mode that replicates your data among the nodes in mongo replicaset.

This happens wether it’s one database or hundreds of databases.

Simply adjust the MONGO_URL to a different database name.

Example:

  • Server 1 MONGO_URL=mongodb://node1,node2,node3/server1?replicaSet=rs0

  • Server 2 MONGO_URL=mongodb://node1,node2,node3/server2?replicaSet=rs0

Both would have their own data

Aaron Ogle
  • 558
  • 3
  • 14
  • Thank you so much for your answer Aaron! That makes total sense! So does it mean that the database will automatically be created if it is not located by rocketchat? Also, can the OpLog be shared by multiple databases since it is required by Rocketchat? – Gyver Chang Jun 19 '19 at 07:50
  • Correct mongo will create the db when Rocket.chat starts up and selects that db to start creating its collections. And yes the single oplog shared by all dbs – Aaron Ogle Jun 29 '19 at 22:02