Skip to content

Instantly share code, notes, and snippets.

@facsiaginsa
Last active April 17, 2020 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save facsiaginsa/b91d7eff470d2f3fc455f3bce0db6662 to your computer and use it in GitHub Desktop.
Save facsiaginsa/b91d7eff470d2f3fc455f3bce0db6662 to your computer and use it in GitHub Desktop.
This is tutorial to load balance jitsi-videobridge using muc mode, it is an upgrade from the old (Component) mode because it will be deprecated soon.

How to Load Balance Jitsi Videobridge using Muc Mode

This is tutorial to load balance jitsi-videobridge using muc mode, it is an upgrade from the old (Component) mode because it will be deprecated soon.

Prerequisite

  1. Jitsi Meet Installed (using quick install)
  2. jitsi Videobridge 2 Installed
  3. java JDK 8 Installed

Get Sudo Privileges

sudo su

Upgrade Package

make sure you have the latest package to apply muc mode on your system

apt-get install jitsi-meet-prosody

note that the jitsi-meet source code will be replaced with the new one, so make sure you backup your existing folder first.

Jicofo Config

open file /etc/jitsi/jicofo/sip-communicator.properties and make sure there is this statement inside. if not, then add this statement your self

org.jitsi.jicofo.BRIDGE_MUC=JvbBrewery@internal.auth.<your.domain.com>

you also have to make sure that there are no pubsub configuration on this file that look like this

org.jitsi.focus.pubsub.ADDRESS=<your.domain.com>
org.jitsi.jicofo.STATS_PUBSUB_NODE=sharedStatsNode

you can delete / comment them if you want to run in muc mode.

Prosody Config

open file /etc/prosody/conf.d/<your.domain.com>.cfg.lua and make sure there are these statement inside. if not, then add this statement your self

Component "internal.auth.<your.domain.com>" "muc"
    storage = "memory"
    modules_enabled = {
        "ping";
    }
    muc_room_cache_size = 1000
    admins = { "focus@auth.<your.domain.com>", "jvb@auth.<your.domain.com>" }

and the check your jvb@auth.<your.domain.com> prosody password in this file (this password is later used for the jvb to connect to muc on JVB Config part bellow).

cat /var/lib/prosody/auth%2e<your%2edomain%2ecom>/jvb.dat

If there is no jvb.dat file, create the user using this comand:

prosodyctl register jvb auth.<your.domain.com> <jvb password>

JVB Config

config file

open /etc/jitsi/videobridge/config make sure you the config is already right:

# Jitsi Videobridge settings

# sets the XMPP domain (default: none)
JVB_HOSTNAME=<your.domain.com> --> this is the domain of the web server, not the jvb server

# sets the hostname of the XMPP server (default: domain if set, localhost otherwise)
JVB_HOST= --> leave this blank

# sets the port of the XMPP server (default: 5275)
JVB_PORT=5347 --> adjust this value to prosody listen port 

# sets the shared secret used to authenticate to the XMPP server
JVB_SECRET=6iHFEg3U --> it doesn't matter anymore

# extra options to pass to the JVB daemon
JVB_OPTS="--apis=rest,"

# adds java system props that are passed to jvb (default are for home and logging config file)
JAVA_SYS_PROPS="-Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/etc/jitsi -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=videobridge -Dnet.java.sip.communicator.SC_LOG$

sip-communicator.properties file

open /etc/jitsi/videobridge/sip-communicator.properties and then add these statement

org.jitsi.videobridge.ENABLE_STATISTICS=true
org.jitsi.videobridge.STATISTICS_TRANSPORT=muc,colibri
org.jitsi.videobridge.xmpp.user.shard.HOSTNAME=<your.domain.com>
org.jitsi.videobridge.xmpp.user.shard.DOMAIN=auth.<your.domain.com>
org.jitsi.videobridge.xmpp.user.shard.USERNAME=jvb
org.jitsi.videobridge.xmpp.user.shard.PASSWORD=<your jvb password> --> from jvb.dat
org.jitsi.videobridge.xmpp.user.shard.MUC_JIDS=JvbBrewery@internal.auth.<your.domain.com>
org.jitsi.videobridge.xmpp.user.shard.MUC_NICKNAME=<unique name for the jvb>
org.jitsi.videobridge.xmpp.user.shard.DISABLE_CERTIFICATE_VERIFICATION=true

if you are behind NAT, also add this 2 statement on this file

org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS=<Local.IP.Address>
org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS=<Public.IP.Address>

Restart All Services

on web server

/etc/init.d/prosody restart
/etc/init.d/jicofo restart

on jvb server

/etc/init.d/jitsi-videobridge2 restart

Checking

To make sure all setup is success, you can check jicofo log

grep 'Added new videobridge' /var/log/jitsi/jicofo.log

You should see your videobridge nickname there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment