Update videobridge installation authored by Roland Alton's avatar Roland Alton
## Adding videobridges
Follow [Jitsi Load balancing guide](https://github.com/jitsi/jicofo/blob/master/doc/load_balancing.md) and the video https://youtu.be/LyGV4uW8km8
This has been deployed on several machines, see https://git.fairkom.net/hosting/fairmeeting/issues/42 . Bare metal preferred.
Prepare videobridge servers with ansible playbook hardening.yml (check SSH port an do a `sshd -t` after running the script so you do not lock yourself out!), requires: `apt-get install python-apt`
Add host name and repo as in this guide first steps https://github.com/jitsi/jitsi-meet/blob/master/doc/quick-install.md#basic-jitsi-meet-install
### Option 1: Jitsi stable release
Now works with default Java 11. ~~Install Java 8 from other repo https://git.fairkom.net/hosting/fairmeeting/issues/50#note_21586~~
```
echo 'deb https://download.jitsi.org stable/' >> /etc/apt/sources.list.d/jitsi-stable.list
wget -qO - https://download.jitsi.org/jitsi-key.gpg.key | apt-key add -
apt update
apt install jitsi-videobridge2 jq
```
### ~~Option 2: Jitsi unstable repo~~
~~Has newer version of videobridge, which is [considered stable](https://community.jitsi.org/t/jvb-2-considered-stable/24314/7) and which should work fine with Java 11 (default in buster).~~
```
echo 'deb https://download.jitsi.org unstable/' >> /etc/apt/sources.list.d/jitsi-unstable.list
wget -qO - https://download.jitsi.org/jitsi-key.gpg.key | apt-key add -
apt update
apt-get install jitsi-videobridge2
```
### configure the new bridge as component
From here the video explains installing only videobridge on VM: https://youtu.be/LyGV4uW8km8?t=879
enable pubsub room in `/etc/jitsi/videobridge/sip-communicator.properties`
```
org.ice4j.ice.harvest.DISABLE_AWS_HARVESTER=true
org.ice4j.ice.harvest.STUN_MAPPING_HARVESTER_ADDRESSES=meet-jit-si-turnrelay.jitsi.net:443
org.jitsi.videobridge.AUTHORIZED_SOURCE_REGEXP=focus@auth.fairmeeting.net/.*
org.jitsi.videobridge.ENABLE_STATISTICS=true
org.jitsi.videobridge.STATISTICS_TRANSPORT=muc,colibri,pubsub
org.jitsi.videobridge.PUBSUB_SERVICE=fairmeeting.net
org.jitsi.videobridge.PUBSUB_NODE=sharedStatsNode
org.jitsi.videobridge.STATISTICS_INTERVAL=5000
# org.ice4j.ice.harvest.ALLOWED_ADDRESSES=144.76.116.175
org.jitsi.videobridge.ENABLE_REST_SHUTDOWN=true
```
**not** used parameters in jvb2 (we still use components):
```
# MUC variant
# org.jitsi.videobridge.STATISTICS_TRANSPORT=muc
# org.jitsi.videobridge.xmpp.user.shard.HOSTNAME=localhost
# org.jitsi.videobridge.xmpp.user.shard.DOMAIN=auth.jvb-hetzner-0.fairmeeting.net
# org.jitsi.videobridge.xmpp.user.shard.USERNAME=jvb
# org.jitsi.videobridge.xmpp.user.shard.PASSWORD=8e8whFtP
# org.jitsi.videobridge.xmpp.user.shard.MUC_JIDS=JvbBrewery@internal.auth.jvb-hetzner-0.fairmeeting.net
# org.jitsi.videobridge.xmpp.user.shard.MUC_NICKNAME=618ada33-1d7b-48b5-a554-45990295e906
```
define in `/etc/jitsi/videobridge/config`
```
JVB_HOSTNAME=fairmeeting.net
JVB_HOST=fairmeeting.net
JVB_SECRET=secret
# extra options to pass to the JVB daemon
JVB_OPTS="--apis=rest,xmpp --subdomain=jvb-HOSTINGPARTNER-0"
```
In `/etc/systemd/system.conf` add
```
DefaultLimitNOFILE=65000
DefaultLimitNPROC=65000
DefaultTasksMax=65000
```
increase the TCP and UDP receive buffer size
check default settings first with `sysctl -a | grep mem`
append in `/etc/sysctl.conf`
```
# increase Linux TCP buffer limits
net.core.rmem_max = 10485760
net.core.wmem_max = 10485760
# increase Linux autotuning TCP buffer limits
# min, default, and max number of bytes to use
net.ipv4.tcp_mem = 382089 509452 764178
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304
# increase Linux autotuning UDP buffer limits
net.ipv4.udp_mem = 764178 1018904 1528356
```
load with `sysctl -p`
### on fairmeeting main server
enter bridge as component with its secret in `/etc/prosody/conf.avail/fairmeeting.net.cfg.lua`
```
Component "jvb-HOSTINGPARTNER-0.fairmeeting.net"
component_secret = "secret"
```
Alternatively, let bridges communicate with MUC https://git.fairkom.net/hosting/fairmeeting/issues/55
`service prosody reload`
`service jitsi-videobridge restart`
For statistics, check /var/log/jitsi/jicofo.log like https://youtu.be/LyGV4uW8km8?t=1269 for messages like `Video stream count for:`