RocketChat / RocketChat/Rocket.Chat
Run snap with external mongo database
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
I am trying to run the rocket chat snap with an already existing mongodb server. My reason for wanting this is that I have various other applications on my server, all of which already connect to a single mongodb instance. This setup simplifies backups and database administration, because I don't have to keep track of separate mongodb databases for every application.
I would like some way to configure rocketchat to use the mongo that is already running on my system instead of spinning up a separate database all for itself.
I have tried setting the mongo host and port for the snap to the one all other applications use, then stopping the snap.rocketchat-server.rocketchat-mongo service and restarting the snap.rocketchat-server.rocketchat-server service. I had hoped that this will force the rocketchat server will connect to my non-snap mongo database, but I get the following error when I query the status:
$ sudo systemctl status snap.rocketchat-server.rocketchat-server
● snap.rocketchat-server.rocketchat-server.service - Service for snap application rocketchat-server.rocketchat-server
Loaded: loaded (/etc/systemd/system/snap.rocketchat-server.rocketchat-server.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2019-05-16 09:44:50 EEST; 1min 37s ago
Main PID: 26704 (startRocketChat)
Tasks: 2 (limit: 4915)
Memory: 1.9M
CGroup: /system.slice/snap.rocketchat-server.rocketchat-server.service
├─26704 /bin/bash /snap/rocketchat-server/1377/bin/startRocketChat
└─29502 sleep 30
May 16 09:44:50 server-hostname-omitted systemd[1]: Stopped Service for snap application rocketchat-server.rocketchat-server.
May 16 09:44:50 server-hostname-omitted systemd[1]: Started Service for snap application rocketchat-server.rocketchat-server.
May 16 09:44:50 server-hostname-omitted rocketchat-server.rocketchat-server[26704]: Mongo is not available, can't start. Waiting 10 seconds and trying again
May 16 09:45:00 server-hostname-omitted rocketchat-server.rocketchat-server[26704]: Mongo is not available, can't start. Waiting 15 seconds and trying again
May 16 09:45:15 server-hostname-omitted rocketchat-server.rocketchat-server[26704]: Mongo is not available, can't start. Waiting 20 seconds and trying again
Is there any way to force snap.rocketchat-server to disable the internal mongodb service and use the one already running on the host?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Rocket.Chat snap service names and the reported systemctl status output, then trace how the snap starts and checks MongoDB availability. Reproduce the external MongoDB configuration described in the issue. Done means the snap can use the host MongoDB instance without requiring its bundled mongo service.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mongodb, typescript
- Domain
- backend, databases, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100