April 14, 2023
After you make your own Jitsi installation you may need need to scale up your system. The main resource requirement here will be the bandwith. So you will need to distribute your network traffic coming from users audio and video streaming. Jitsi has a very compact and robust solution for that. Jitsi Bridge. As its name implies it is the bridge between conference users. All streaming flow goes through these bridges. You can install mutiple bridges in different VMs and connect them to your main jitsi server through Jicofo( Jitsi’s Conference Focus component). And Jitsi distributes your streaming workload between these bridges. There is no need for load balancer or any other external component. Very simple and yet practical. Installing these Jitsi Video Bridge’s are fairly simple but as other Jitsi compenents configuration of the bridges can be somehow confusing. So I hope this manual may help others who wish to set up their multiple Jitsi Bridge instances.
Installation Note: Following setup will be for the first video bridge (we will be named it as jitsibridge1) for other video bridge installations you may go with jitsibridge1, jitsibridge2, etc… Hostname, FQDN, IP parameters in the commands should be replaced respectively.
Run;
sudo hostnamectl set-hostname jitsibridge1.YOUR_DOMAIN
Edit /etc/hostname file as;
jitsibridge1.YOUR_DOMAIN
Edit /etc/hosts file as;
127.0.0.1 localhost
YOUR_LOCAL_IP_IF_ANY jitsibridge1.YOUR_DOMAIN jitsibridge1
YOUR_PUBLIC_IP jitsibridge1.YOUR_DOMAIN jitsibridge1
127.0.0.1 localhost jitsibridge1.YOUR_DOMAIN
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
To restart VM run;
reboot
After restart to test your FQDN setup run;
ping “$(hostname)”
Should ping 127.0.0.1 and command out put will be similar to;
PING jitsibridge1.YOUR_DOMAIN (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.026 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.041 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.045 ms
Run following commands;
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-get install apt-transport-https
apt update
apt upgrade
Note: To go safe, choose Keep current versions of config files if prompted.
Important note: You need to be careful to allow your own ssh port. It is assumed here that shh connection port is 22. You shoud change with your yours if it is different. Otherwise you may not reconnect to your VM after you logged out.
Run;
ufw allow 22/tcp &&
ufw allow 443/tcp &&
ufw allow 4443/tcp &&
ufw allow 10000/udp &&
ufw enable
Note: As hostname, enter FQDN of Main Jitsi Server (YOUR_JITSI_DOMAIN) when prompted during the install.
Run;
apt -y install jitsi-videobridge2
Now you need to configure your newly installed VM to connect your new bridge to your main jitsi server.
_Note:
Abbreviations will be used in this section;
JMS: Jitsi Main Server
JVB: Jitsi Video Bridge _ Switch to root as always;
sudo su -
Edit /etc/jitsi/videobridge/sip-communicator.properties files in your JVB VM.
Final content of jitsibridge1 server sip-communicator.properties file should be;
org.ice4j.ice.harvest.DISABLE_AWS_HARVESTER=true
#If your Jitsi set up is behing the NAT comment out the line below
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=YOUR_JITSI_DOMAIN
org.jitsi.videobridge.xmpp.user.shard.DOMAIN=auth.YOUR_JITSI_DOMAIN
org.jitsi.videobridge.xmpp.user.shard.USERNAME=SAME_AS_JMS_BRIDGE_CONFIG
org.jitsi.videobridge.xmpp.user.shard.PASSWORD=SAME_AS_JMS_BRIDGE_CONFIG
org.jitsi.videobridge.xmpp.user.shard.MUC_JIDS=JvbBrewery@internal.auth.YOUR_DOMAIN
org.jitsi.videobridge.xmpp.user.shard.MUC_NICKNAME=jitsibridge1
#If your Jitsi setup is behing the NAT set up your local ip othervise comment out
org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS=YOUR_LOCAL_IP
#If your Jitsi setup is behing the NAT set up your public ip othervise comment out
org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS=YOUR_PUBLIC_IP
org.jitsi.videobridge.xmpp.user.shard.DISABLE_CERTIFICATE_VERIFICATION=true
Before testing restart your new Video Bridge to show up your new configuration. To do so run;
/etc/init.d/jitsi-videobridge2 restart
Check logs for error.
In JVB; /var/log/jitsi/jvb.log
In JMS; /var/log/jitsi/jvb.log and /var/log/jitsi/jicofo.log
If JVB is connected to JMS, you should see in /var/log/jitsi/jicofo.log something like;
INFO: [31] org.jitsi.jicofo.bridge.BridgeSelector.log() Added new videobridge: Bridge[jid=jvbbrewery@internal.YOUR_JITSI_DOMAIN/jitsibridge1, relayId=null, region=null, stress=0.00]
Further testing stop all Jitsi Video Bridges in all JVB VMs connected to JMS VM -except you want to test- with;
/etc/init.d/jitsi-videobridge2 stop .
Now you should be using only your newly installed Video Bridge.
To test your conference go to Jitsi-meet from your Chrome browser;
https://YOUR_JITSI_DOMAIN/test123
Then from other Chrome browser window (preferably from different PC or mobile app) and go to:
https:/YOUR_JITSI_DOMAIN/test123#config.p2p.enabled=false
Note: Jitsi uses p2p connection by default when there are two participants in the conference room. In the URL above, query string parameter config.p2p.enabled=false forces jitsi-meet to use JVB connection other than using peer to peer (p2p) connection which is direct connection of conference participants.
Now you have your new Jitsi Video Bridge instance running!And if you need support for Jitsi do not hesitate to contact us. We are giving professional grade Jitsi consultation service including installation, integration, customisation and maintenance support.