Script for Autoscaling JVB

Here is step by step I did to my prosody.

  1. added mod_admin_rest in prosody.cfg.lua
  2. Then I restart prosody service.
  3. Then I register one user.

I can’t hit api with that user credential like you said.

{"result":"Host does not exist or is malformed"}

Above error return. Can you please guide me your step by step? Thanks a lot

Make sure you add this to your header

--header 'Host:'
1 Like

I copy your url and change my credentials and host , then still got this error.

Can you try adding this config in your prosody.cfg.lua

admins = { }
component_interface = ""

Hi Anthony ,

I am also trying to set up multi JVB platform for auto-scaling.Do you have any documents or step by step guide which can help me to achieve the same .Your help would be appreciated.


You can try the following:

  1. Register jvb in prosody server
prosodyctl register jvb yourjvbpassword
  1. Spin up a new jvb instance and install jvb only.
  2. You may follow this sample for /etc/jitsi/videobridge/
  1. Modify /usr/share/jitsi-videobridge/ and add this on top
RAND=`openssl rand -hex 5`
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/
  1. Restart jvb and check for any errors.
  2. If no errors, enable auto start
systemctl enable jitsi-videobridge2
  1. Shutdown server and create your image and autoscaling.
1 Like

Hi @waiyanwinhtain,

You may follow the guide above. It does not require the mod_admin_rest anymore as it is using the same jvb account in all autoscaled instances.

1 Like

Thanks Anthony.It works fine now .

Does this work on Ubuntu 18.04?

Can I know which version you have tested this on?

Yes it works on Ubuntu 18.04 which we are using now. It also works on RHEL/CentOS if you know how to port the jar files and startup scripts.

Why do you prefer to use a modification, instead of a system startup script? Like for example rc.local or a custom systemd service?
rc.local works well and is straightforward, you only need to change the nickname - everything else can be pre-set in the jvb config files.

A custom modification in means you have to take care it’s not being overwritten on package upgrades, while rc.local is a part of the system configuration and won’t be changed on upgrades.

For example something like this in /etc/rc.local:

sed -i -e “s/.*MUC_NICKNAME=.*/org.jitsi.videobridge.xmpp.user.shard.MUC_NICKNAME=`uuidgen`/” /etc/jitsi/videobridge/

1 Like

Or even better:

sed -i -e “s/MUC_NICKNAME=.*/MUC_NICKNAME=`uuidgen`/” /etc/jitsi/videobridge/

This way you won’t touch the “shard” name and you can have a properties file with multiple shards for the JVB to connect to, you change only its nickname. :wink:
If you are using AWS or something similar and you have IDs of the instances, you can use these instanceIDs for nicknames, so that you can recognize the JVBs easier in the logs.


I have these two:


sed changes only the active MUC_NICKNAME line


@yasen @emrah
Thanks for the tips guys!

How de we configure in prosody in meet server?
Keep it default or do we need to modify?
And also jvb config need to modify?
Follow are my configs

# Jitsi Videobridge settings

# sets the XMPP domain (default: none)

# sets the hostname of the XMPP server (default: domain if set, localhost otherwise)

# sets the port of the XMPP server (default: 5275)

# sets the shared secret used to authenticate to the XMPP server

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

# adds java system props that are passed to jvb (default are for home and logging config file)
JAVA_SYS_PROPS=" -Djava.util.logging.config.file=/etc/jitsi/videobridge/"


With above configs, I got the following error logs from prosody and jvb

Jun 29 14:55:19 jcp55cac213bed0 info    component disconnected: nil (false)
Jun 29 14:55:24 jcp55cac27593b0 info    Incoming Jabber component connection
Jun 29 14:55:24 mod_component   info    Disconnecting component, <stream:error> is: <stream:error><host-unknown xmlns='urn:ietf:params:xml:ns:xmpp-streams'/><text xmlns='urn:ietf:params:xml:ns:xmpp-streams'> does not match any configured external components</text></stream:error>


=====>: org_jitsi_modified_sctp4j_SctpJni.c calling init
=====>: org_jitsi_modified_sctp4j_SctpJni.c about to set SCTP_DEBUG_ALL
2020-06-29 14:51:15.731 INFO: [27] Performed a successful health check in PT1.089S. Sticky failure: false
2020-06-29 14:51:19.704 SEVERE: [32] ComponentMain.lambda$getConnectCallable$0#293: host-unknown,, port:5347
org.xmpp.component.ComponentException: host-unknown
        at org.jivesoftware.whack.ExternalComponent.connect(
        at org.jivesoftware.whack.ExternalComponentManager.addComponent(
        at org.jivesoftware.whack.ExternalComponentManager.addComponent(
        at org.jitsi.retry.RetryStrategy$
        at java.util.concurrent.Executors$
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(
        at java.util.concurrent.ScheduledThreadPoolExecutor$
        at java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.util.concurrent.ThreadPoolExecutor$

Coz I am very new to this application.
I really appreciate your help and guide.

I have used your method and works great but I only use it like this: sed -i -e “s/bncwiebn-jdnxuw-etc/$(uuidgen)/g” /etc/jitsi/videobridge/ I put this script in start-up of the jvb’s and then restart the videobridge to have a fully functional jvb server created when autoscaling create a new one. I have a question, anyone have experience setting up octo? I have searched a lot, but when I make modifications to Jicofo jitsi-meet crashes. I don’t know why.

AutoScaling Discussion in relation to AWS EC2 Instances
-In AWS AutoScaling => We should use Step Policy vs Target Tracking Policy in Autoscaling ?? …As Simple AutoScaling will soon deprecate.

-Scale Out (What is the Maximum Network load which crosses then it should Scale Out …I am applying Network In towards JVB)

-Scale In (What is the minimum Network load which lowers then it Scale In…This also applying Network In toward JVB) but using SQS & Graceful Shutdown

It would really depend on the bandwidth each of your EC2 can handle i.e. c5n.metal instances can handle up to 100Gbps. I think this might be helpful

Hello @emrah how to use this? Where I put? I want autsocale AWS are name new JVB like so - JVB1 JVB2. How I do? Where I put this scripts?

The locations are in the path

/etc/systemd/system/jvb-config.service /etc/systemd/system/

/usr/local/sbin/jvb-config /usr/local/sbin/

then set the execute permission

chmod 755 /usr/local/sbin/jvb-config