Best, easy method to scale jibri? (2-4 recorders)

I’m a beginner at all this, so please be patient.

What’s the current, best solution to moderately scale jibri (2-4 simultaneous recorders) in digital ocean? I’ve played with docker containers, dabbled with kubernetes, and tried to just setup two droplets side-by-side, all with no luck.

Is there a simple, straightforward guide to achieving this?

I’ve read the install instructions on github :slight_smile:

Thanks!

This is my guide

1 Like

thanks for the response! I’ve actually tried you guide a few times, but can’t get it working beyond the basic jitsi install.

“Create or install a Debian Buster server for each node in this tutorial.” does this mean individual droplets or servers, or do they all live on the same host? What’s the process for doing this?

Hello @SuperJimbo,

Each node is an individual Debian 10.x droplet.

Digital Ocean’s Debian droplet has not snd_aloop support which is needed for Jibri. Therefore first install the standart kernel and then reboot.

apt-get update
apt-get install linux-image-amd64
reboot

After the reboot, apply the instructions on the guide. I assumed that your are already defined a DNS A record for your JMS host.

If you have a problem, inform me.

Thanks! This is very helpful:

Each node is an individual Debian 10.x droplet.

I’ve setup the initial JMS node successfully, but getting a “recording unavailable” error when trying to record.

Hello @SuperJimbo,

How many CPU cores are there? If it’s less than 4 cores, there will be no running Jibri intance.
The first two cores are reserved for the base processes. After these two cores, one Jibri instance is started for each additional 2 cores.

For example if there is 8 cores, 2 cores are used by the system and 6 cores are used by the Jibri instances. There will be 3 Jibri instances (6 / 2 = 3) in this case.

To check the number of cores:

nproc --all

And to list the running instances:

lxc-ls -f

If you increase your droplet size, the Jibri instances will be started in the next boot. You don’t need to change anything else.

amazing! Thank you! I’ve been struggling with this for weeks and your guide + posts here finally helped me get it working!

Now, to optimize! Is there any way I could run a jibri node on a lower-spec droplet? I want to keep costs down, but jibri won’t launch on lower powered droplets.

Thanks!

1 Like

Jibri run a chromium instance and ffmpeg, they are very resource hungry (CPU & RAM). I don’t know a good way to decrease their needs.

Understood.

One question - what is the file path for the jitsi and jibri configuration files? I know they’re inside the “eb-jitsi” container, but I can’t find them.

Thanks!

/etc/jitsi/ in eb-jitsi container. It’s possible to access the same location inside the host using the path /var/lib/lxc/eb-jitsi/rootfs/etc/jitsi/. These two places are same.

Thanks! Another question, what’s the best way to setup a finalization script with your installer? It seems whenever I put a script in the standard location:

/var/lib/lxc/eb-jibri/delta0/etc/jitsi/jibri/

It doesn’t stay there after a reboot, and it also isn’t triggered automatically after the recording is done, as specified in the config file:

“finalize_recording_script_path”: “/var/lib/lxc/eb-jibri/delta0/etc/jitsi/jibri/rclone.googledrive.upload.sh”,

Hello @SuperJimbo,

The Jibri instances are created by cloning the eb-jibri-template. All running Jibri instances are ephemeral and they will be deleted after shutdown.

I f you want to add/change something permanently, you should to add it to the template, eb-jibri-template

And a container don’t know anything about the outside of its namespace. There is no such a thing /var/lib/lxc/eb-jibri/delta0/etc/jitsi/jibri/rclone.googledrive.upload.sh for a Jibri instance. Use the path /etc/jitsi/jibri/rclone.googledrive.upload.sh

  • Add/change the files which are in /var/lib/lxc/eb-jibri-template/rootfs directory to make them permanant.

  • Edit /var/lib/lxc/eb-jibri-template/rootfs/etc/jitsi/jibri/config.json file to change the script path.

  • Put your script in /var/lib/lxc/eb-jibri-template/rootfs/usr/local/bin/

  • Set the execute permission

  • Stop and start the Jibri service on the host. This service will recreate all the Jibri instances again

systemctl stop jibri-ephemeral-container.service
systemctl start jibri-ephemeral-container.service
  • All recording are in /usr/local/eb/recordings/. This is a mount point. It’s accessable from the host and from the Jibri containers using the same path.

Thanks, I’ve tried saving the script as you’ve suggested, in the proper location, but I’m getting the following error in the log:

2020-06-22 00:39:08.166 SEVERE: [35] org.jitsi.jibri.service.impl.FileRecordingJibriService.finalize() Failed to run finalize script: java.io.IOException: Cannot run program “/etc/jitsi/jibri/rclone.googledrive.upload.sh”: error=2, No such file or directory with stack:

It seems that your config is OK but the script is not in the right place or there is some issue related in its permissions

Could you paste the output of the following command?

ls -alh /var/lib/lxc/eb-jibri-template/rootfs/etc/jitsi/jibri/

total 24K
drwxr-xr-x 2 root root 4.0K Jun 13 04:12 .
drwxr-xr-x 3 root root 4.0K Jun 13 04:11 …
-rw-r–r-- 1 root root 2.9K Jun 22 00:37 config.json
-rw-r–r-- 1 root root 1.7K Aug 21 2019 logging.properties
-rw-r–r-- 1 root root 6.3K Aug 21 2019 xorg-video-dummy.conf

if helpful:

-rwxr-xr-x 1 root root 240 Jun 21 22:56 /var/lib/lxc/eb-jibri-template/rootfs/usr/local/bin/rclone.googledrive.upload.sh

The path in the config file and the real location are not match.

Your script is /usr/local/bin/rclone.googledrive.upload.sh but the config file tries to find it at /etc/jitsi/jibri/rclone.googledrive.upload.sh

Put the script in /var/lib/lxc/eb-jibri-template/rootfs/etc/jitsi/jibri/ or change the path in the config file as /usr/local/bin/rclone.googledrive.upload.sh

Still getting this error in the log

2020-06-22 18:12:28.997 SEVERE: [35] org.jitsi.jibri.service.impl.FileRecordingJibriService.finalize() Failed to run finalize script: java.io.IOException: Cannot run program “/etc/jitsi/jibri/rclone.googledrive.upload.sh”: error=2, No such file or directory with stack:
java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)

the script is definitely here:

total 28K
drwxr-xr-x 2 root root 4.0K Jun 22 15:23 .
drwxr-xr-x 3 root root 4.0K Jun 13 04:11 …
-rw-r–r-- 1 root root 2.9K Jun 22 18:08 config.json
-rw-r–r-- 1 root root 1.7K Aug 21 2019 logging.properties
-rwxr-xr-x 1 root root 247 Jun 22 17:25 rclone.googledrive.upload.sh
-rw-r–r-- 1 root root 6.3K Aug 21 2019 xorg-video-dummy.conf

Did you restart the container?