Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Script to start Rocket.Chat in HA mode during development #22398

Merged
merged 4 commits into from
Aug 23, 2021

Conversation

d-gubert
Copy link
Member

Proposed changes (including videos or screenshots)

Sometimes we need to start Rocket.Chat in High-Availability mode (cluster) during development to test how a feature behaves or hunt down a bug. Currently, this involves a lot of commands with details that might be lost if you haven't done it in a while.

This PR intends to provide a really simple way for us to start many instances of Rocket.Chat connected in a cluster.

How to

To start up a cluster, you need to first start the "main" instance. This will be started just like you'd do with a single server in development - with the meteor command, running on port 3000. To do it, run npm run ha.

Then, when you want to add an instance to the cluster, go to another terminal and run npm run ha:add. This will start another server on port 3030, providing all necessary parameters for it to correctly connect to the "main" instance and forming a cluster. If you want to add even more servers, you will need to provide a different port manually, like so: PORT=3050 npm run ha:add.

There is, of course, a lot of room for improvement, but it makes the DevEx much smoother when compared to starting the other instances manually with a big line passing a lot of environment variables to the command.

Issue(s)

Steps to test or reproduce

Further comments

@d-gubert d-gubert requested review from ggazzo and sampaiodiego June 17, 2021 20:23
@geekgonecrazy
Copy link
Contributor

Why have we never done this before? Thats genius! So much easier then doing manually

@d-gubert d-gubert marked this pull request as ready for review July 6, 2021 20:53
.scripts/run-ha.ts Outdated Show resolved Hide resolved
@sampaiodiego sampaiodiego merged commit 2915d1e into develop Aug 23, 2021
@sampaiodiego sampaiodiego deleted the chore/ha-development branch August 23, 2021 20:11
@sampaiodiego sampaiodiego mentioned this pull request Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants