A single Jitsi Meet server can work very well for small video conferences, but when we need to hold a conference with more than 30 or 40 participants, it is necessary to add additional nodes to avoid overloading the server's CPU/RAM. Here, we detail the steps to add more Videobridge servers to handle video conferences and thus distribute the load across several servers to host conferences with more users without affecting the experience.
Requirements for installing the environment
- Two or more servers running Ubuntu 20.04, Ubuntu 18.04 or Debian 10. The first server will have a full Jitsi installation and the remaining servers only Jitsi Videobridge.
- Open ports 80, 443, 10000 to 20000, 5222, 5347 in the client panel firewall. The following link explains how to create a firewall rule.
- If you want to access Jitsi using a domain name, you will need to create two DNS records for it to work: "server.midominio.com A ip_pública" and "auth.server.midominio.com A ip_pública".
Installing Jitsi Meet Server
Connect to the main server via SSH and run the following commands to update the server:
# apt update
# apt upgrade -yNow you will need to add the Jitsi repository for installation:
# 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*For Debian, you may need to install the following dependencies:
# apt install gnupg gnupg2 gnupg1Run the following command to install Jitsi Meet:
# apt install jitsi-meet -yDuring installation, you will be asked for the domain name. In this case, set the DNS record created at the beginning named server.midominio.com.
Select the first option to generate the certificate with Let's Encrypt later.
Jitsi is now ready, but accessing it will produce an error because the SSL certificate does not exist.
Create a Let's Encrypt SSL certificate
Stay on the main node to create the SSL certificate so the web environment works. To do this, run the following commands:
# apt install python3-certbot-nginx
# certbot --nginx --redirect -d server.midominio.comDepending on the operating system version you chose, the commands may not be suitable. In this case, you can follow this article: Generate Let's Encrypt certificates with Certbot.
Now that you have created the certificate, it is time to use your browser to access the URL server.midominio.com and check that the default installation without the extra nodes works correctly. It is important to verify from two different devices that video calls work correctly at this point.
Configure load balancing
Still on the main node, edit the file "/etc/jitsi/videobridge/sip-communicator.properties" with the command:
# vi /etc/jitsi/videobridge/sip-communicator.propertiesAdd the following two lines:
org.jitsi.videobridge.DISABLE_TCP_HARVESTER=true
org.jitsi.videobridge.xmpp.user.shard.DISABLE_CERTIFICATE_VERIFICATION=trueEdit the following variable to set its value to jvb1 to identify the main node:
org.jitsi.videobridge.xmpp.user.shard.MUC_NICKNAME=jvb1The resulting file should resemble the following content, making sure the domain name is correct:
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.ENABLE_STATISTICS=true
org.jitsi.videobridge.STATISTICS_TRANSPORT=muc
org.jitsi.videobridge.xmpp.user.shard.HOSTNAME=localhost
org.jitsi.videobridge.xmpp.user.shard.DOMAIN=auth.server.midominio.com
org.jitsi.videobridge.xmpp.user.shard.USERNAME=jvb
org.jitsi.videobridge.xmpp.user.shard.PASSWORD=0917Q9Nz
org.jitsi.videobridge.xmpp.user.shard.MUC_JIDS=JvbBrewery@internal.auth.server.midominio.com
org.jitsi.videobridge.xmpp.user.shard.MUC_NICKNAME=jvb1
org.jitsi.videobridge.DISABLE_TCP_HARVESTER=true
org.jitsi.videobridge.xmpp.user.shard.DISABLE_CERTIFICATE_VERIFICATION=trueAdd a second Jitsi Videobridge node
Now that you have installed and configured the main server, you can add more nodes to the Jitsi cluster to serve more users. To do this, first update the operating system:
# apt update && apt upgrade -yAdd the repository and install Jitsi Videobridge:
# 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 -y*For Debian, you may need to install the following dependencies:
# apt install gnupg gnupg2 gnupg1During installation, you will be asked for the hostname, and you must again specify the main server's hostname, which in this case is server.midominio.com.
Once Jitsi Videobridge is installed, edit the following file:
# vi /etc/jitsi/videobridge/sip-communicator.propertiesTo add the following lines:
org.jitsi.videobridge.DISABLE_TCP_HARVESTER=true
org.jitsi.videobridge.xmpp.user.shard.DISABLE_CERTIFICATE_VERIFICATION=trueIn the same file, find the variable "org.jitsi.videobridge.xmpp.user.shard.HOSTNAME" and specify the hostname of the main domain "server.midominio.com". Also, edit the variable "org.jitsi.videobridge.xmpp.user.shard.MUC_NICKNAME" and set it to "jvb2" to identify the second node.
The resulting file should look like this:
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.ENABLE_STATISTICS=true
org.jitsi.videobridge.STATISTICS_TRANSPORT=muc
org.jitsi.videobridge.xmpp.user.shard.HOSTNAME=server.midominio.com
org.jitsi.videobridge.xmpp.user.shard.DOMAIN=auth.server.midominio.com
org.jitsi.videobridge.xmpp.user.shard.USERNAME=jvb
org.jitsi.videobridge.xmpp.user.shard.PASSWORD=0917Q9Nz
org.jitsi.videobridge.xmpp.user.shard.MUC_JIDS=JvbBrewery@internal.auth.server.midominio.com
org.jitsi.videobridge.xmpp.user.shard.MUC_NICKNAME=jvb2
org.jitsi.videobridge.DISABLE_TCP_HARVESTER=true
org.jitsi.videobridge.xmpp.user.shard.DISABLE_CERTIFICATE_VERIFICATION=trueConfigure the credentials to connect the servers
Reconnect to the main server and run the following command:
# cat /etc/jitsi/videobridge/config |grep JVB_SECRET
JVB_SECRET=0917Q9NzSave the value of "JVB_SECRET" which in this case is "0917Q9Nz", which you will need to copy to the additional Jitsi Videobride nodes.
Now reconnect to the additional Jitsi Videobridge node and edit the following file:
# vi /etc/jitsi/videobridge/config
Edit the variable "JVB_SECRET" and set the main node's password "0917Q9Nz".
You will also need to edit the following file:
# vi /etc/jitsi/videobridge/sip-communicator.properties
Edit the variable "org.jitsi.videobridge.xmpp.user.shard.PASSWORD" and set the main node's password "0917Q9Nz".
Restart services
On the main node, run the following:
# service prosody reload
# service jicofo restart
# service jitsi-videobridge2 restart
# service nginx restart
On each additional Jitsi Videobridge node, run this:
# service jitsi-videobridge2 restartWhere can you find the logs?
On the main node, you can review logs in the following files:
/var/log/jitsi/jicofo.log
/var/log/jitsi/jvb.log
/var/log/prosody/prosody.logOn the additional nodes, you will find them in:
/var/log/jitsi/jvb.logRecommendations
- To avoid overloading the main server, it is recommended that the service "jitsi-videobridge2" always remain stopped and that the additional Jitsi Videobridge nodes handle the workload.
- To add another Jitsi Videobridge node, follow the same steps in "Add a second Jitsi Videobridge node" but replace "jvb2" with "jvb3" and so on for each additional node.
These steps have shown you how to add nodes to Jitsi Meet Server to handle video calls and thus accommodate more users than would be possible on a single server.