This guide is currently only valid for a special distribution of the Rocket.Chat.
The feature will be released for General Availability on the Enterprise Edition v4.0
NATS
Please refer to NATS Docker installation on how to deploy NATS
MongoDB
Storage Engine needs to be WiredTiger:
Rocket.Chat
The setting Use REST instead of WebSocket for Meteor calls under Admin > General > REST API, must be enabled.
The following environment variables should be set for Rocket.Chat services as well:
Variable | Value | Description |
|
| NATS address |
|
| Disables internal DB watcher and rely on |
|
| Disables presence monitoring and rely on the |
|
| Do not run external services on rocket.chat process |
Rocket.Chat microservices are composed of a few Docker containers:
Responsible for user authentications
docker run \--name accounts-service \-e MONGO_URL=mongodb://mongo/rocketchat?replicaSet=rs01 \-e TRANSPORTER=nats://nats:4222 \rocketchat/account-service:latest
Responsible for the validation of access to features
docker run \--name authorization-service \-e MONGO_URL=mongodb://mongo/rocketchat?replicaSet=rs01 \-e TRANSPORTER=nats://nats:4222 \rocketchat/authorization-service:latest
Web socket interface between server and clients
docker run \--name ddp-streamer \-e MONGO_URL=mongodb://mongo/rocketchat?replicaSet=rs01 \-e TRANSPORTER=nats://nats:4222 \rocketchat/ddp-streamer-service:latest
DDP Streamer should be scaled from the beginning. (One per 500 concurrent users should be good enough)
Can not be scaled to multiple containers
Receives real-time data from MongoDB and emits that data to the system.
docker run \--name mongodb-stream-hub \-e MONGO_URL=mongodb://mongo/rocketchat?replicaSet=rs01 \-e TRANSPORTER=nats://nats:4222 \rocketchat/stream-hub-service:latest
Controls and update users' presence status.
In a situation where you have a huge amount of data/users, you can get away with not running it to reduce the traffic of presence processing. If you are not running it, the user's online/offline status and notification will not work properly.
​
docker run \--name presence-service \-e MONGO_URL=mongodb://mongo/rocketchat?replicaSet=rs01 \-e TRANSPORTER=nats://nats:4222 \rocketchat/presence-service:latest
Set the following environment variables to enable Prometheus metrics:
Variable | Default | Description |
|
| Enable Prometheus metrics endpoint |
|
| Port of Prometheus metrics endpoint |
Once all services are up and running the web socket connections should be targeted to ddp-streamer
containers, the configuration depends on the reverse proxy you have set up, but you need to change the following routes:
/sockjs
/websocket
If using Kubernetes, an Ingress like the following can be used:
apiVersion: extensions/v1beta1kind: Ingressmetadata:name: ddp-streamerspec:rules:- host: your-hostname.rocket.chathttp:paths:- backend:serviceName: ddp-streamerservicePort: 3000path: /(sockjs|websocket)
To summarize it:
You just need to deploy the reverse proxy to split the communication.
Run all the above services pointing to the NATS and the MongoDB.
Deploy NATS.
Run Rocket.Chat according to the above-mentioned variables.