Full Scalelite Installation Using Lazy Development - April 2024

129 views
Skip to first unread message

Anand Christudas

unread,
Apr 17, 2024, 4:51:04 PMApr 17
to BigBlueButton-Setup

Scalelite installation

Follow the installation steps as given below and you will be able to install scalelite within a few min without any errors and make any adjustments as needed for your server.


sudo -i


Create a VM

sudo apt update

sudo apt upgrade


Make Hostname of the server you domain name

sudo hostnamectl set-hostname scalelite.example.com


Make the timezone of both BBB and Scalelite the same. Use the first code to get the timezone and second replace the second one with your timezone

timedatectl list-timezones

timedatectl set-timezone Asia/Kolkata


Create Swap memory

sudo fallocate -l 1G /swapfile

sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576

sudo chmod 600 /swapfile

sudo mkswap /swapfile

sudo swapon /swapfile

echo '/swapfile swap swap defaults 0 0' | sudo tee -a /etc/fstab


Install Docker


sudo apt-get update

sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

sudo apt-get install docker-ce docker-ce-cli containerd.io 

Install Docker Compose

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

docker compose version


Fetching the scripts

sudo -i

cd

git clone https://github.com/jfederico/scalelite-run

cd scalelite-run

cp dotenv .env


sed -i "s/SECRET_KEY_BASE=.*/SECRET_KEY_BASE=$(openssl rand -hex 64)/" .env

sed -i "s/LOADBALANCER_SECRET=.*/LOADBALANCER_SECRET=$(openssl rand -hex 24)/" .env

sed -i 's/SL_HOST=.*/SL_HOST=scalelite.example.com/' .env

sed -i 's/DOMAIN_NAME=.*/DOMAIN_NAME=scalelite.example.com/' .env


nano .env

change SCALELITE_DOCKER_IMAGE to the latest version referring to scalelite github.

Start the services.(Note that if you are on Docker 25 and 26 you will receive an error and won't be able to continue if you are using docker-compose up -d so instead use the below code 


docker compose up -d


nginx and certbot containers won’t start, just continue the next steps.


Generate LetsEncrypt SSL certificates manually

source ./.env

certbot certonly --manual -d $DOMAIN_NAME --agree-tos --no-bootstrap --manual-public-ip-logging-ok --preferred-challenges=dns --email your...@gmail.com --server https://acme-v02.api.letsencrypt.org/directory


add the txt record to DNS and Click Enter


Move the generated certificate to the certbot folder

cp -r /etc/letsencrypt/* /root/scalelite-run/data/certbot/conf/


Create production log file

cd scalelite-run

cat docker-compose.yml | grep srv

cd log/scalelite-api/

touch production.log

chmod 777 production.log

exit


Initializing or Migrating the database

Just run the below code to initialize the database but mostly it will give you an error saying the database exists, just ignore the error and continue the installation


docker exec -i scalelite-api bundle exec rake db:setup

docker exec -t scalelite-api bundle exec rake db:migrate


Configuration


You can check the server status.

docker exec -i scalelite-api bundle exec rake status


Pulling the list of servers.

docker exec -i scalelite-api bundle exec rake servers


Add some BigBlueButton servers.

Server 1

docker exec -i scalelite-api bundle exec rake servers:add[https://bbb1.yourbbbserver.com/bigbluebutton/api/,secretkey]


Server 2

docker exec -i scalelite-api bundle exec rake servers:add[https://bbb2.yourbbbserver.com/bigbluebutton/api/,secretkey]


Server 3

docker exec -i scalelite-api bundle exec rake servers:add[https://bbb1.yourbbbserver.com/bigbluebutton/api/,secretkey]


That should give you an ID for each server added.

Use the server ID to enable the server.


docker exec -i scalelite-api bundle exec rake servers:enable[server ID]


And lastly, although the poller will update the servers. It can also be run manually.

docker exec -i scalelite-api bundle exec rake poll:all


Additionally, the servers can also be disabled.


docker exec -i scalelite-api bundle exec rake servers:disable[server ID]


Taken out of the pool.

docker exec -i scalelite-api bundle exec rake servers:panic[server ID]


Removed Server.

docker exec -i scalelite-api bundle exec rake servers:remove[server ID]


Bigbluebutton Server side setting

sudo -i

wget -qO- https://raw.githubusercontent.com/jfederico/scalelite-run/master/init-recordings-bigbluebutton.sh | bash -s -- -s scalelite.example.com


You will receive a key when this code finishes running copy that 


Now go to scalelite server run the below code and paste the code inside


nano /home/bigbluebutton/.ssh/authorized_keys 


Now go back to the bigbluebutton server and run the below commands

sudo -i

su - bigbluebutton -s /bin/bash

mkdir -p ~/.ssh ; chmod 0700 ~/.ssh

nano ~/.ssh/config (make sure the content of this config file looks something like the below with bigbluebutton as a user or whichever user that the code you received has in it)


Host scalelite-spool

  HostName scalelite.example.com

  User bigbluebutton

  Port 22

  IdentityFile ~/.ssh/id_rsa


Now SSH into your scalelite server for the first time, make sure you ssh using the user mentioned above.


ssh scalelite.example.com (replace with your scalelite server url)


it will ask you to add this server to the trusted list, type in yes. This step is very important because if you don't add it rsync will never be able to sync using SSH as each time when it runs the server will be saying it's not a trusted server in the background and the link will never be established.


Transferring old recording from the bigbluebutton server

https://github.com/blindsidenetworks/scalelite/blob/master/docs/sharedvolume-README.md

https://github.com/blindsidenetworks/scalelite/blob/master/bigbluebutton/scalelite_batch_import.sh

Go to the BBB server and copy the above file to any folder in the BBB server and change /post_publish/scalelite_post_publish.rb file name to post_publish_scalelite.rb


apt install ruby2.7-dev libsystemd-dev

gem install redis builder nokogiri loofah open4 absolute_time journald-logger

gem install nokogiri -v 1.15.6

gem install loofah -v 2.10.0

./scalelite_batch_import.sh


Remove recorded files older than N days in Scalelite

nano /etc/cron.daily/scalelite-recording-cleanup


#!/bin/bash

URI=scalelite.example.com #your scalelite server url like: loadbalancer.test.test

SALT=###### #your scalelite server secret

MAX_AGE=30


MAX_DATE=$(date -I -d "-$MAX_AGE days")


for MEET in $( docker exec -u postgres postgres psql -d scalelite -c "SELECT record_id FROM recordi>


LINK="deleteRecordingsrecordID=$MEET$SALT"


KEY=$(echo -n "$LINK" | openssl sha1 |awk '{print $2}')


FLINK="https://$URI/bigbluebutton/api/deleteRecordings?recordID=$MEET&checksum=$KEY"

echo "deleting $MEET"

curl $FLINK

done


sudo chmod +x /etc/cron.daily/scalelite-recording-cleanup


Recording cleanup cronjob for BBB for recordings transferred to Scalelite

nano /etc/cron.daily/scalelite_prune_recordings


https://github.com/blindsidenetworks/scalelite/blob/master/bigbluebutton/scalelite_prune_recordings


chmod +x /etc/cron.daily/scalelite_prune_recordings


Update Scalelite


cd scalelite-run

docker compose pull 

docker compose up -d 

docker exec -t scalelite-api bundle exec rake db:migrate


Reply all
Reply to author
Forward
0 new messages