Cooking a toucan in a container, or a RuBackup 2.0 stand
Hi all!
Backup is insurance against the loss of critical data. Regardless of the size and scope of a company, backup tools are essential so that a business can continue to function in the event of hardware failures, human error, or cyber attacks.
RuBackup is an enterprise-class system client-server solution for automated data backup and recovery.
This article will be useful to people who interact with RuBackup, solving work tasks, or are simply interested in technical innovations in the field of backup. Here is information on how to quickly and effortlessly roll out the RuBackup 2.0 demo stand.
The release date for version 2.0.49 is May 25, 2023.
For trial use, a minimal configuration of RuBackup RMS is available, consisting of a main backup server and several clients. It allows you to perform backup and restore with a total backup volume of no more than 1TB.
This article suggests the following ways to try RuBackup:
With the help of a script.
With the help of a Docker container.
Using Docker Compose.
Everyone will be able to choose the method that suits him and “touch” the new version of the RMS live.
1. Script – all in one
The database, client, server and graphical manager will be installed on one virtual machine.
Precondition: packages rubeup-common_2.0.49-1_amd64.deb,
rubackup-client_2.0.49-1_amd64.deb, rubackup-server_2.0.49-1_amd64.deb,
rubbackup-rbm_2.0.49-1_amd64.deb and this script are in the same folder.
Tested on Astra Linux 1.7.2 and Ubuntu 20.04.
install_rubackup.sh
#!/bin/bash
userName="user"
if [[ $(id -u) != 0 ]]; then
echo "Please, as root"
exit 1
fi
apt-get update
# Client dependencies
apt-get -y install openssl
# Server dependencies
debconf-set-selections <<< "postfix postfix/mailname string rubackup-mail"
debconf-set-selections <<< "postfix postfix/main_mailer_type string 'No configuration'"
apt-get -y install mailutils libcurl4
# Rbm dependencies
apt-get -y install libqt5sql5-psql
# Specific dependencies
PRETTY_NAME=$(grep "PRETTY_NAME" /etc/os-release)
if [[ "$PRETTY_NAME" == *"$Ubuntu 20.04"* ]]; then
apt-get -y install libicu66
elif [[ "$PRETTY_NAME" == *"$Astra Linux"* ]]; then
apt-get -y install libicu63 parsec-base parsec-cap parsec-mac
fi
/usr/bin/dpkg -i rubackup-common_2.0.49-1_amd64.deb rubackup-client_2.0.49-1_amd64.deb rubackup-server_2.0.49-1_amd64.deb rubackup-rbm_2.0.49-1_amd64.deb
if [[ $? != 0 ]]; then
echo "Error: dpkg return not null! Exit"
exit 1
fi
# Paths to /opt/rubackup/lib and /opt/rubackup/bin
cat << EOF >> /root/.bashrc
PATH=$PATH:/opt/rubackup/bin
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rubackup/lib
export PATH
export LD_LIBRARY_PATH
EOF
tail -n 4 /root/.bashrc >> /home/$userName/.bashrc
# Add daemons
systemctl enable /opt/rubackup/etc/systemd/system/rubackup_client.service
systemctl enable /opt/rubackup/etc/systemd/system/rubackup_server.service
systemctl daemon-reload
# Install and config postgres
apt-get -y install postgresql postgresql-contrib
sudo -u postgres psql -c "alter user postgres password '12345';"
if [[ "$PRETTY_NAME" == *"$Astra Linux"* ]]; then
sudo -u postgres psql -c "create user rubackup with superuser createrole login password '12345';"
sed -i 's/zero_if_notfound: no/zero_if_notfound: yes/g' /etc/parsec/mswitch.conf
fi
pg_ver=$(psql --version)
pg_ver=${pg_ver:18:2}
cat << EOF > /etc/postgresql/$pg_ver/main/pg_hba.conf
local all postgres peer
host all all 127.0.0.1/32 md5
host all all 192.168.0.0/16 md5
EOF
echo "listen_addresses="*"" >> /etc/postgresql/$pg_ver/main/postgresql.conf
systemctl restart postgresql
# Config RuBackup
mkdir /default_pool
mkdir /rubackup_tmp
iface=$(ip link | head -3 | tail -1 | grep -oP ': \K.*?(?=:)')
/opt/rubackup/bin/rb_init -y -n primary-server -H 127.0.0.1 -X 12345 -Y 12345 -i $iface -f /default_pool -l /rubackup_tmp
if [[ $? != 0 ]]; then
echo "Error: rb_init return not null! Exit"
exit 1
fi
systemctl restart rubackup_server
systemctl restart rubackup_client
2. Docker – all in one container
The same as the script, only in a container prepared for you.
https://hub.docker.com/r/rubackup/rubackup_server
docker run -d -p 10022:22 -h rubackup_server --name rubackup_server rubackup/rubackup_server:2.0.49
We go into the container via ssh, forward the graphics:
ssh -X -p 10022 user@localhost
1
rbm
3. Docker compose – server and multiple clients
Let’s raise a group of containers, the same server and several clients to it. The PostgreSQL module is included.
docker-compose.yml
version: "3"
services:
rubackup_server:
image: "rubackup/rubackup_server:2.0.49"
container_name: rubackup_server
hostname: rubackup_server
networks:
rb_network:
ipv4_address: 172.18.0.10
ports:
- "10022:22"
expose:
- "22"
- "5432"
- "9991"
- "9992"
- "9993"
- "9995"
rubackup_client_1:
image: "rubackup/rubackup_client:2.0.49"
container_name: rubackup_client_1
hostname: rubackup_client_1
networks:
- rb_network
links:
- rubackup_server
rubackup_client_2:
image: "rubackup/rubackup_client:2.0.49"
container_name: rubackup_client_2
hostname: rubackup_client_2
networks:
- rb_network
links:
- rubackup_server
networks:
rb_network:
ipam:
driver: default
config:
- subnet: 172.18.0.0/24
docker-compose up -d
Or like this:
docker run -d --ip 172.17.0.2 -p 10022:22 -h rubackup_server --name rubackup_server rubackup/rubackup_server:2.0.49
docker run -d --add-host=rubackup_server:172.17.0.2 -h rubackup_client_1 --name rubackup_client_1 rubackup/rubackup_client:2.0.49
docker run -d --add-host=rubackup_server:172.17.0.2 -h rubackup_client_2 --name rubackup_client_2 rubackup/rubackup_client:2.0.49
I hope this tutorial saved you time. All the best!