DEV Community

Kai
Kai

Posted on

How to configure Jitsi Meet with multiple Videobridge nodes

Introduction

In this article, we going to configure an existing Jitsi meet installation with multiple/two videobridge nodes. Jitsi meet is an open source video streaming application that offers similar functionalities to Zoom. This tutorial assumes that you have completed a default (single node) Jitsi Meet installation. For default Jitsi Meet installation, please refer to this guide.

Jitsi meet has an in-built load balancing functionality, and can be configured to manage multiple Videobridge nodes for hosting meeting conferences. Each videobridge component is responsible for streaming media data to all the participants of a given set of meeting. To configure Jitsi meet with multiple videobridge nodes, we will need to change all the videobridge node to publish their status to the default XMPP server. At the same time, we will change the Jicofo component in Jitsi meet to subscribe to the XMPP node for events published by all videobridge nodes.

Prerequisits

In this article, we assume you already have a server (Server A) with default Jitsi Meet installation, and we going to set up a second videobridge in a separate server machine (Server B).

PART A. Configuration Change to Server A

Let's SSH onto Server A, this machine has a default Jitsi meet installation, and by default it also has one videobridge component.

Please note in this tutorial, the domain name <domainname> or <dnsname> is the domain of the main Jitsi server (Server A).

Step 1. Add the JIDs of the Videobridges

First, we need to allow all videobridges to be able to create their own pubsub nodes. Let's add the JIDs of the videobridge nodes to Prosody. In Prosody configuration /etc/prosody/conf.d/<dnsname>.cfg.lua, add the following line under authentication = ...



  admins = {
    "jitsi-videobridge.<dnsname>",
    "videobridge2.<dnsname>",
  }


Enter fullscreen mode Exit fullscreen mode

In this tutorial we use the above two subdomains jitsi-videobridge and videobridge2 as dns for each videobridge node. In some Jitsi versions, jitsi-videobridge is the default domain name used by videobridge. videobridge2 is the domain we chose for the second videobridge node. After the change, your configuration file should look like below.



VirtualHost "<dnsname>"
  -- enabled = false -- Remove this line to enable this host
  authentication = "internal_plain" //Note this value can be "anonymous", if you haven't enabled authentication
  admins = {
    "jitsi-videobridge.<dnsname>",
    "videobridge2.<dnsname>",
  }
  ...


Enter fullscreen mode Exit fullscreen mode

Step 2. Change configuration of default Videobridge node

Now, edit the videobridge configuration in /etc/jitsi/videobridge/config, and look for the configuration line JVB_OPTS="--apis=,", and change it to following.



JVB_OPTS="--apis=rest,xmpp --subdomain=jitsi-videobridge"
JVB_HOST=<domainname> 


Enter fullscreen mode Exit fullscreen mode

Step 3. Change Prosody to listen to public interface

Since we going to have lots of videobridge nodes connecting from outside the server box, we need to change Prosody to listen to the public network. Edit the prosody configuration /etc/prosody/prosody.cfg.lua to listen for public IP, add the following configuration under admin = { }



component_ports = {5347}
component_interface = "<IPaddress>"  //replace this IP address with the public IP of your main Jitsi Meet server (Server A)


Enter fullscreen mode Exit fullscreen mode

Note the IP address here is dependent on your network setup. If you have issue with connecting to the prosody from external videobridge nodes, try change this IP to 0.0.0.0, which listens for all IP ranges.

Step 4. Change Jicofo configuration to use public domain

Now, change the following configuration files to replace localhost with your jitsi domain.
First, /etc/jitsi/jicofo/config



JICOFO_HOST=<domainname>  //domain name is the domain name of your jitsi server (Server A)


Enter fullscreen mode Exit fullscreen mode

Step 5. Change default Videobridge node to use pubsub

In /etc/jitsi/videobridge/sip-communicator.properties to enable statistics and to set statistics to use pubsub, make the following changes. Add the following lines if they are missing, or otherwise if STATISTIC_TRANSPORT is set to muc change it to pubsub.



org.jitsi.videobridge.ENABLE_STATISTICS=true
org.jitsi.videobridge.STATISTICS_TRANSPORT=pubsub
org.jitsi.videobridge.PUBSUB_SERVICE=<domainname>
org.jitsi.videobridge.PUBSUB_NODE=sharedStatsNode


Enter fullscreen mode Exit fullscreen mode

Step 6. Change Jicofo to subscribe to pubsub node

In /etc/jitsi/jicofo/sip-communicator.properties file, adding the following lines



org.jitsi.focus.pubsub.ADDRESS=<domainname>
org.jitsi.focus.STATS_PUBSUB_NODE=sharedStatsNode


Enter fullscreen mode Exit fullscreen mode

Step 7. Open Ports on the main server (Server A)

Make sure the following ports are open:

  • TCP/UDP Port 5347
  • TCP/UDP Port 5222 //TODO: verify the purpose of this port

PART B. Changes on the second videobridge server (Server B)

Now, let's install the second Videobridge on the other server. First, SSH on to the second server (Server B).

Step 1. Add the Jitsi package library

Run following command as super user to add the Jitsi debian package and key.



$ echo 'deb https://download.jitsi.org stable/' | sudo tee /etc/apt/sources.list.d/jitsi-stable.list
$ wget -qO -  https://download.jitsi.org/jitsi-key.gpg.key | sudo apt-key add -


Enter fullscreen mode Exit fullscreen mode

If you hit an error like gnupg, gnupg2 and gnupg1 do not seem to be installed, you will need to install gnupg or gnupg2 using apt-get install gnupg2. Then you can add the key after that.

Step 2. Install jitsi videobridge

run the following command



$ apt-get update
$ apt-get install jitsi-videobridge


Enter fullscreen mode Exit fullscreen mode

During the installation, we will get prompted for domain name of the main server, replace localhost with the domain name of the main server.

Step 3. Configure Videobridge to use pubsub

in /etc/jitsi/videobridge/sip-communicator.properties to enable statistics and to set statistics to use pubsub, make the following changes. Add the following lines if they are missing, or otherwise if STATISTIC_TRANSPORT is set to muc, change it to pubsub. Make sure the domainname is pointing to server A.



org.jitsi.videobridge.ENABLE_STATISTICS=true
org.jitsi.videobridge.STATISTICS_TRANSPORT=pubsub
org.jitsi.videobridge.PUBSUB_SERVICE=<domainname>
org.jitsi.videobridge.PUBSUB_NODE=sharedStatsNode


Enter fullscreen mode Exit fullscreen mode

Step 4. Configure Videobridge to connect to the main server

Now, edit the videobridge configuration in /etc/jitsi/videobridge/config, and look for the configuration line JVB_OPTS="--apis=,", and change it to following.



JVB_OPTS="--apis=rest,xmpp --subdomain=videobridge2" 
JVB_HOST=<domainname> 


Enter fullscreen mode Exit fullscreen mode

By default, the JID uses jitsi-videobridge as the default subdomain, so in this second node, we set the subdomain as videobridge2.

PART C. Add new videobridge components to main Jitsi server (Server A)

Step 1. Set videobridge credentials

Log back onto Serve A. Edit the file in /etc/prosody/conf.d/<dnsname>.cfg.lua, at the bottom of the main VirtualHost add the following



Component "videobridge2.<dnsname>" //This is the domain name of the second videobridge
   component_secret = "<password>" //This can be found on second VB, under /etc/jitsi/videobridge/config


Enter fullscreen mode Exit fullscreen mode

Check the component list, make sure the componet_secret of Component "jitsi-videobridge..." is set, and is the same as the value in /etc/jitsi/videobridge/config on server A. Note in some Jitsi Meet version, this setting can be missing, so make sure you add this component if it's missing.



Component "jitsi-videobridge.<dnsname>" //This is the domain name of the default videobridge
   component_secret = "<password>" //This can be found on first VB, under /etc/jitsi/videobridge/config


Enter fullscreen mode Exit fullscreen mode

Step 2. Restart the services on Server A



$ sudo service prosody reload
$ sudo service jicofo restart
$ sudo service jitsi-videobridge restart
$ sudo service nginx restart


Enter fullscreen mode Exit fullscreen mode

Step 3. Restart videobridge on Server B



$ sudo service jitsi-videobridge restart


Enter fullscreen mode Exit fullscreen mode

Done.

Check the following log files on Server A to verify the videobridge nodes are joined successfully.



$ tail -f /var/log/jitsi/jicofo.log
$ tail -f /var/log/jitsi/jvb.log
$ /var/log/prosody/prosody.log


Enter fullscreen mode Exit fullscreen mode

In your prosody.log file, you should see something like this.
videobridge2.<domainname>:component info External component successfully authenticated

Check the following log files on Serve B.



/var/log/jitsi/jvb.log


Enter fullscreen mode Exit fullscreen mode

Top comments (8)

Collapse
 
mupati profile image
Kofi Mupati • Edited

For the latest version of jitsi and prosody, I had to remove xmpp from in both server 1 and 2

JVB_OPTS="--apis=rest,xmpp --subdomain=videobridge2" 
Enter fullscreen mode Exit fullscreen mode

for it to work.

JVB_OPTS="--apis=rest --subdomain=videobridge2" 
Enter fullscreen mode Exit fullscreen mode
Collapse
 
ntakma profile image
ntakma

hello, i config following this post. it great! but When 3 people connected to the room, it crashed. do u help me. thanks

Collapse
 
jackzro profile image
jackzro

i have same problem with you. do you have any solution for this problem ??? or somebody can help me how to solve it ? please info me at su_jackson99@yahoo.com

Collapse
 
dev_for profile image
Dev Master

Did you find any resolution? @ntakma @jackzro @danny899
The video is not showing when 3 people connected to the room.

Collapse
 
testaccountsnt profile image
Derek O'Brien • Edited

Adding component in the file /etc/prosody/conf.d/dnsname.cfg.lua, do we need to create subdomains jitsi-videobridge.dnsname & videobridge2.dnsname in DNS management of the domain and point it to the IPs of their respective servers?

Collapse
 
mvraja profile image
mvraja

hi everyone. am facing an error while following the setup. where can i check the component list that was mentioned in part c step 1. am not able to see the logs that was mentioned in the guide. is it needed to stop the jvb in main server? as am new to the environment am facing lots of problems. could any one help me to reach this out. my own server instance:
Amazon EC2 instance
Ubuntu 18.0.4

Collapse
 
gdi3d profile image
Adriano Galello

Great post man!, I'm currently working and Ya!Meeting and I think this could be a nice option for some of our users.

Collapse
 
puneetsethi25 profile image
puneetsethi25

Hey nice thanks for the post. But does it work with jitsi-videobridge2 also ??