Skip to content
Snippets Groups Projects
Commit 31b0980b authored by Julian's avatar Julian
Browse files

Fixed follower setup, added README, enabled Buster

parent f77522d8
No related branches found
No related tags found
No related merge requests found
Pipeline #9234 waiting for manual action
......@@ -37,6 +37,16 @@ package:apt:bullseye:
needs:
- build:binary:bullseye
# for now, publish the bullseye package for buster as well
publish:apt:buster:
extends: .publish:apt
variables:
APTLY_DISTRO: buster
dependencies:
- package:apt:bullseye
needs:
- package:apt:bullseye
publish:apt:bullseye:
extends: .publish:apt
variables:
......
README.md 0 → 100644
Third-party RocketChat Package for Debian
=========================================
RocketChat is a web-based chat platform. See https://rocket.chat/ for details.
This is a package for deploying RocketChat on Debian Buster or Bullseye.
**Disclaimer:** This package is provided by a third party. It is **not** an
official package from the RocketChat project or the Debian project. It is
automatically built from upstream releases without any review or testing.
The package does not fully adhere to Debian packaging standards (especially
regarding the vendoring of dependencies).
Prerequisite: Node.js 12
------------------------
**This only applies to Debian Buster.** The Node.js version in Debian
Bullseye is new enough.
RocketChat requires at least version 12 of Node.js. The package in the official
Debian repositories for Debian Buster is too old.
Enable nodesource.com Debian repo:
```sh
wget -q https://deb.nodesource.com/gpgkey/nodesource.gpg.key -O /etc/apt/trusted.gpg.d/nodesource.asc
echo "deb https://deb.nodesource.com/node_12.x buster main" > /etc/apt/sources.list.d/nodesource.list
apt update
```
Installing the RocketChat package later automatically installs Node.js as a
dependency.
Prerequisite: MongoDB
---------------------
MongoDB is not available in the official Debian repositories. However, the
MongoDB project provides a third-party repo for Debian.
MongoDB can be installed on the same system as RocketChat or on a separate
system. The default config in the RocketChat package expects a local
installation of MongoDB.
Enable the mongodb.org Debian repo, install the `mongodb-org` package, enable
and start the `mongod` service:
```sh
wget https://www.mongodb.org/static/pgp/server-4.2.asc -O /etc/apt/trusted.gpg.d/mongodb.asc
echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" > /etc/apt/sources.list.d/mongodb.list
apt update
apt install mongodb-org
systemctl enable mongod
systemctl start mongod
```
Note: At the time of writing there is no repo for Debian Bullseye on
repo.mongodb.org. The Debian Buster repo seems to work fine on Bullseye.
RocketChat requires [setting up a replica set](https://docs.rocket.chat/quick-start/installing-and-updating/manual-installation/mongo-replicas).
Configure the replica set, start MongoDB and initialize the replica set:
```sh
printf 'replication:\n replSetName: "rs01"\n' >> /etc/mongod.conf
systemctl start mongod
mongo --eval 'rs.initiate()'
```
If you install MongoDB on the same host as RocketChat, the corresponding
MongoDB URL is `mongodb://localhost:27017/rocketchat?replicaSet=rs01` and
the oplog URL is `mongodb://localhost:27017/local?replicaSet=rs01`. These
are the default values, so you don't need to change the RocketChat config
in `/etc/rocketchat.conf`.
Install and Setup RocketChat
----------------------------
Enable the `infrapackages-rocketchat` repo on https://packages.cccv.de/,
then install the package `rocketchat`:
```sh
wget https://packages.cccv.de/docs/cccv-archive-key.gpg -O /etc/apt/trusted.gpg.d/cccv-archive.asc
echo "deb https://packages.cccv.de/infrapackages-rocketchat bullseye main" > /etc/apt/sources.list.d/cccv-rocketchat.list
apt update
apt install rocketchat
```
Customize the configuration in `/etc/rocketchat.conf` and restart RocketChat
with `systemctl restart rocketchat`.
Per default RocketChat listens on `http://localhost:3000/`. Open
`http://localhost:3000/` in a webbrowser and follow the setup instructions.
Setup Follower Instances
------------------------
Node.js applications are single-threaded. If you have more than a single CPU
core, you will want to run [additional RocketChat instances ("followers") on
the same host](https://docs.rocket.chat/quick-start/installing-and-updating/manual-installation/multiple-instances-to-improve-performance)
to improve performance.
The package includes the systemd service template `rocketchat-follower@`. The
instance name is used as the IP the RocketChat follower instance binds to.
Note that the official guide uses different ports for follower instances
instead of different IPs. We found that with enabled Prometheus metrics,
follower instances fail to start as they attempt to bind the same metrics
port as the main instance.
Follower instances use the same config options as the main instance
(`/etc/rocketchat.conf`). Options can be overwritten for followers in
`/etc/rocketchat-follower.conf`
To enable one follower (e.g. on a system with two CPUs) run:
```sh
systemctl enable rocketchat-follower@127.0.0.2
systemctl restart rocketchat
```
Afterwards the two instances will listen on `http://127.0.0.1:3000/` and
`http://127.0.0.1:3001/`. Setup a load-balancer to use both instances as
upstreams.
build/bundle /usr/share/rocketchat
rocketchat.service /lib/systemd/system/
rocketchat-follower@.service /lib/systemd/system/
rocketchat.conf /etc/
rocketchat-follower.conf /etc/
README.md /usr/share/doc/wekan/
# Both the main rocketchat service and the rocketchat-follower@ services use
# the config options from "/etc/rocketchat.conf". Use this file to overwrite
# options for the rocketchat-follower@ services.
# Note that for followers BIND_IP is automatically set to the instance name.
# E.g. for rocketchat-follower@127.0.0.2.service BIND_IP is set to 127.0.0.2,
# so the service binds to 127.0.0.2.
DISABLE_PRESENCE_MONITOR=YES
......@@ -3,20 +3,20 @@ Description=RocketChat Server (follower, depending on main service)
After=network.target
Wants=network-online.target
Wants=systemd-networkd-wait-online.service
PartOf=rocketchat.service
[Service]
ExecStart=/usr/bin/node /usr/share/rocketchat/bundle/main.js
# Overwrite BIND_IP from config files with instance name. We cannot use
# Environment for this, since EnvironmentFile takes precedence over it.
ExecStart=env BIND_IP=%I /usr/bin/node /usr/share/rocketchat/bundle/main.js
Restart=on-failure
RestartSec=10
ExecReload=/bin/kill -USR1 $MAINPID
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=rocketchat
EnvironmentFile=/etc/rocketchat.conf
Environment=NODE_ENV=production
Environment=DISABLE_PRESENCE_MONITOR=YES
Environment=PORT=%I
EnvironmentFile=/etc/rocketchat.conf
EnvironmentFile=/etc/rocketchat-follower.conf
DynamicUser=true
PrivateUsers=true
......@@ -43,4 +43,4 @@ SystemCallArchitectures=native
SystemCallFilter=@system-service
[Install]
WantedBy=multi-user.target
WantedBy=rocketchat.service
# BIND_IP only applies to the main instance. Follower instances
# (rocketchat-follower@ services) use the instance name as their BIND_IP.
BIND_IP=127.0.0.1
# Overwritten with PORT for rocketchat-follower@<PORT>
PORT=3000
ROOT_URL=http://localhost
MONGO_URL="mongodb://localhost:27017/rocketchat?replicaSet=rs01"
MONGO_OPLOG_URL="mongodb://localhost:27017/local?replicaSet=rs01"
# Overwritten with YES for rocketchat-follower@
DISABLE_PRESENCE_MONITOR=NO
# Use /etc/rocketchat-follower.conf to overwrite options for
# rocketchat-follower@ services.
......@@ -9,12 +9,10 @@ ExecStart=/usr/bin/node /usr/share/rocketchat/bundle/main.js
Restart=on-failure
RestartSec=10
ExecReload=/bin/kill -USR1 $MAINPID
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=rocketchat
EnvironmentFile=/etc/rocketchat.conf
Environment=NODE_ENV=production
EnvironmentFile=/etc/rocketchat.conf
DynamicUser=true
PrivateUsers=true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment