Chore: Script to start Rocket.Chat in HA mode during development #22398
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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, runnpm 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