Snap Installation - MongoDB Replica Set


#1

I have deployed a snap install of RocketChat on Ubuntu 18.04 and it has less than 20 active users currently. But, it is expected that this number will scale up to around 700 - 800 in the near future.

Based on reading the support docs / installation FAQs, it looks like I have to deploy multiple instances / a mongodb replica set for the type of load that I am expecting. I saw detailed installation instructions for a manual install with multiple mobo db instances. However, I am wondering if it is possible to deploy a replica set in a snap installation - If so, are there any write-ups / documentation that I could refer to ?


#2

Currently this… mostly not possible. While technically you could start another mongo node and join it into your replicaset it would be outside the snap, and a manual install.

Then you also would have to scale out the rocket.chat server to multiple instances to handle more load. That’s also not possible in the snap… you would have to start other instances of Rocket.Chat up on another server or manually on the same server.

Most find by time you go through all of that trouble its easier to switch to a manual install.


#3

Thanks, Aaron!

Multiple servers should not be a problem. Am I right in understanding that other instances of Rocket.Chat that are to be part of the replica set can’t be snap instances on their own servers?

The option you seem to suggest is to create a new manual install on another server and follow the replica set directions. Would it be possible to import the database from the current snap install into the manual one ?


#4

By default mongo in snap listens on 127.0.0.1 only for security. If we were to change you could probably run multiple snaps. but it would be tricky. Since snap autoupdates your mongo replicaset would be at great risk for failure.

Absolutely. Snaps have an database dump command. See the snap FAQ: https://rocket.chat/docs/installation/manual-installation/ubuntu/snaps/#faq