Script for Autoscaling JVB

Hi All,

In order to allow autoscaling of JVB, there are a few steps required:

Signalling server:

  1. Add mod_admin_rest module in prosody module folder /usr/lib/prosody/modules/mod_admin_rest.lua. (
  2. Modify /etc/prosody/prosody.cfg.lua and add an admin account (e.g. and enable admin_rest module.
  3. Reload prosody.
  4. Open port 5280 access to the JVB instances.

JVB image server:
4. On a fresh install of JVB2, modify /usr/share/jitsi-videobridge/ and add the following lines on top

RAND=`openssl rand -hex 5`
JVB_SECRET=`openssl rand -hex 10`
LOCAL_ADDRESS=`hostname -I | awk '{print $1}'`
sed -i "s/\(JVB_SECRET=\).*\$/\1${JVB_SECRET}/" /etc/jitsi/videobridge/config
sed -i "s/\(org.jitsi.videobridge.xmpp.user.shard.USERNAME=\).*\$/\1${USERNAME}/" /etc/jitsi/videobridge/
sed -i "s/\(org.jitsi.videobridge.xmpp.user.shard.PASSWORD=\).*\$/\1${JVB_SECRET}/" /etc/jitsi/videobridge/
sed -i "s/\(org.jitsi.videobridge.xmpp.user.shard.MUC_NICKNAME=\).*\$/\1${NICKNAME}/" /etc/jitsi/videobridge/
sed -i "s/\(\).*\$/\1${LOCAL_ADDRESS}/" /etc/jitsi/videobridge/
sed -i "s/\(\).*\$/\1${PUBLIC_ADDRESS}/" /etc/jitsi/videobridge/
sed -i "s/\(org.jitsi.videobridge.octo.BIND_ADDRESS=\).*\$/\1${LOCAL_ADDRESS}/" /etc/jitsi/videobridge/
sed -i "s/\(org.jitsi.videobridge.octo.PUBLIC_ADDRESS=\).*\$/\1${PUBLIC_ADDRESS}/" /etc/jitsi/videobridge/
sed -i "s/\(org.jitsi.videobridge.REGION=\).*\$/\1${BRIDGE}/" /etc/jitsi/videobridge/
curl --location --request POST $URL --header 'Content-Type: application/json' --header 'Host:' --header 'Authorization: Basic YWRtaW5AbWVldC5qaXQuc2k6cGFzc3dvcmQ=' --data '{"password":"'"$JVB_SECRET"'"}'

What this does is generate a random JVB username and password and register to prosody by a webservice call.

We have implented this and it is working well for us. Additionally, make sure that jvb2 is setup properly before modifying, things such as updating ca cert should be in place.


You can use same jvb username and password just different nickname, that way you create the username and password once.

Thanks for the tip!