An easy-to-follow step-by-step process to install Scalelite load balancer for BigBlueButton
For the Scalelite Server, the minimum recommended server requirements are:
- 4 CPU Cores
- 8 GB Memory
For the external Redis Cache, the minimum recommended server requirements are:
- 2 CPU Cores
- 0.5GB Memory
- Persistence must be enabled
To switch your Front-End application to use Scalelite instead of a single BigBlueButton server, there are 2 changes that need to be made
- BigBlueButton server url should be set to the url of your Scalelite deployment http(s):///bigbluebutton/api/
- BigBlueButton shared secret should be set to the LOADBALANCER_SECRET value that you set in /etc/default/scalelite
sudo -i
apt-get update
apt-get dist-upgrade# Check if you already have sawp memory.
swapon --show
# If above shows empty, it means you don't have swap memory. Follow the steps below to add swap memory.
fallocate -l 1G /swapfile
dd if=/dev/zero of=/swapfile bs=1024 count=1048576 chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
# Make the change permanent
# Edit /etc/fstab to add /swapfile swap swap defaults 0 0apt install apt-transport-https ca-certificates curl software- properties-common
apt install apt-transport-https ca-certificates curl software- properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt- key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
apt update
apt install docker-cesudo curl -L "https://github.com/docker/compose/releases/download/1.28.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-composegit clone https://github.com/manishkatyan/scalelite-run
cd scalelite-run# Create a new .env file based on the dotenv file included.
cp dotenv .envMost required variables are pre-set by default, the ones that must be set before starting are:
- SECRET_KEY_BASE=
- LOADBALANCER_SECRET=
- URL_HOST=
- NGINX_SSL=
Obtain the value for SECRET_KEY_BASE with:
openssl rand -hex 64You should see something like this: a7441a3548b9890a8f12b385854743f3101fd7fac9353f689fc4fa4f2df6cdcd1f58 bdf6a02ca0d35a611b9063151d70986bad8123a73244abb2a11763847a45
Obtain the value for LOADBALANCER_SECRET with
openssl rand -hex 24You should see something like this: c2d3a8e27844d56060436f3129acd945d7531fe77e661716
Set the hostname on URL_HOST (E.g. scalelite.example.com) When using a SSL certificate set NGINX_SSL to true
Your final .env file should look like this:
SECRET_KEY_BASE=cddacbc1474df5b899a1fb3c614551f301218fa58d9e7804bd05321437a4f1c96fe5438a6ea610fe68204a109fcbc90a1f78b97d2dbf6ef391f845c6ba454043
LOADBALANCER_SECRET=c2d3a8e27844d56060436f3129acd945d7531fe77e661716
URL_HOST=scalelite.example.com
NGINX_SSL=trueFor using a SSL certificate signed by Let’s Encrypt, generate the certificates.
./init-letsencrypt.shStart the services.
docker-compose up -dNow, the scalelite server is running, but it is not quite yet ready. The database must be initialized.
docker exec -i scalelite-api bundle exec rake db:setupIt is important to mention that Scalelite doesn’t have a UI for administration. Instead it comes with a set of back-end scripts (rake tasks) that must be run using the Command Line for configuring and managing the BigBlueButton servers that will be used.
You can check the server status.
docker exec -i scalelite-api bundle exec rake statusYou should notice that there are no servers configured. That can also be verified with pulling the list of servers.
docker exec -i scalelite-api bundle exec rake serversBut you can add some BigBlueButton servers.
docker exec -i scalelite-api bundle exec rake servers:add[https://bbb1.example.com/bigbluebutton/api/,bbb-secret]That should give you an ID for each server added.
OK
id: 27243e91–35a3–42ee-80a7-bd5980b0728fUse the server ID for enabling the server.
docker exec -i scalelite-api bundle exec rake servers:enable[27243e91–35a3–42ee-80a7-bd5980b0728f]Servers can be also be disabled.
docker exec -i scalelite-api bundle exec rake servers:disable[27243e91–35a3–42ee-80a7-bd5980b0728f]Pulled out of the pool.
docker exec -i scalelite-api bundle exec rake servers:panic[27243e91–35a3–42ee-80a7-bd5980b0728f]Or removed.
docker exec -i scalelite-api bundle exec rake servers:remove[27243e91–35a3–42ee-80a7-bd5980b0728f]For more detailed information regarding server management, read the README file in the official git repository.
Your BigBlueButton servers are now ready to be used. You can use Scalelite with any external application (such as Moodle or Wordpress) by setting its hostname as the BigBlueButton URL and the secret generated (LOADBALANCER_SECRET) during the installation as the BigBlueButton Secret.
URL: https://scalelite.example.com/bigbluebutton/api/
Secret: c2d3a8e27844d56060436f3129acd945d7531fe77e661716We use NFS for recordings.
sudo apt update
sudo apt install nfs-kernel-serverAllow ports 22, 80 and 443 for normal Scalelite functioning.
Then execute the following to allow connection from BBB server (BBB_SERVER_IP) for NFS:
$ ufw allow from BBB_SERVER_IP to any port nfsAdd following in /etc/exports:
/mnt/scalelite-recordings BBB_SERVER_IP(rw,sync,no_root_squash) BBB_SECOND_SERVER_IP(rw,sync,no_root_squash)Then execute the following to start NFS server:
exportfs -r
sudo systemctl start nfs-kernel-server.service Create scalellite directory as detailed below
sudo cd /var/bigbluebutton/recording
sudo mkdir scalelite
sudo chown bigbluebutton:bigbluebutton scaleliteOn each BigBlueButton server, install the following files to the listed paths:
- scalelite_post_publish.rb: install to the directory /usr/local/bigbluebutton/core/scripts/post_publish
- scalelite.yml: install to the directory /usr/local/bigbluebutton/core/scripts
- scalelite_batch_import.sh: install to the directory /usr/local/bigbluebutton/core/scripts.
You need to update scalelite.yml
vi scalelite.yml
work_dir: /var/bigbluebutton/recording/scalelite
spool_dir: /mnt/scalelite-recordings/var/bigbluebutton/spoolIn case you need to manually transfer recordings from BigBlueButton server to Scalelite, execute the following:
chmod +x scalelite_batch_import.sh
./scalelite_batch_import.shRun these commands to create the group and add the bigbluebutton user to the group
# Create a new group with GID 2000
sudo groupadd -g 2000 scalelite-spool
# Add the bigbluebutton user to the group
sudo usermod -a -G scalelite-spool bigbluebutton
# In case you face any permission issue, do the following [reference](https://groups.google.com/g/bigbluebutton-setup/c/LT1IFWG9lQE/m/bpDpaG1UAgAJ)
sudo usermod -a -G bigbluebutton bigbluebuttonNow verify that there is no permission issue when bigbluebutton user creates a file, the file should be available on Scalelite server:
sudo -n -u bigbluebutton touch /mnt/scalelite-recordings/var/bigbluebutton/spool/toto.txtInstall NFS client.
sudo apt update
sudo apt install nfs-common
mkdir /mnt/scalelite-recordings
mount SCALELITE_SERVER_IP:/mnt/scalelite-recordings /mnt/scalelite-recordingsNow execute the following command to check recordings folders are correctly mounted on BBB server:
df -hAdd the following entry to your /etc/fstab file in each BBB server:
SCALELITE_SERVER_IP:/mnt/scalelite-recordings /mnt/scalelite-recordings nfs defaults 0 0Restart BigBlueButton server
sudo bbb-conf --restart
sudo bbb-conf --checkA large part of above installation steps shared by Jesus Federico