Skip to main content

MariaDB Galera Cluster @OracleLinux9.5 using ClusterControl install-cc script with limited Internet connection (via Satellite server).

Download, choose 'Full ISO' packages selection:

  • (2025-02-12 -- ClusterControl is only compatible with x86_64 systems)

Install OS in minimal mode, without GUI.

https://yum.oracle.com/oracle-linux-isos.html
For example, OracleLinux-R9-U5-x86_64-dvd.iso 

HLD (High-Level Design)

(one VM is connected to Internet)
lt58ncp1sat1 - Repository satellite 

(others are NOT connected to Internet):
lt58ncp1dbm1 - Monitoring, ClusterControl

lt58ncp1dbn1 - Node 1, MariaDB Galera Cluster
lt58ncp1dbn2 - Node 2, MariaDB Galera Cluster
lt58ncp1dbn3 - Node 3, MariaDB Galera Cluster

Preparations:

  • ensure NO cockpit service running, it occupies port 9090, same as Prometheus uses.

Firewall with firewalld on ClusterControl

systemctl enable firewalld
systemctl start  firewalld
systemctl status firewalld
firewall-cmd --add-service=http       --permanent
firewall-cmd --add-service=https      --permanent
firewall-cmd --add-service=prometheus --permanent
firewall-cmd --reload

Firewall with firewalld on the cluster nodes

systemctl enable firewalld
systemctl start  firewalld
systemctl status firewalld
firewall-cmd --add-service=mysql --permanent
firewall-cmd --reload

Temporary disable SElinux for installation, it will be enabled later

sed -i 's|SELINUX=enforcing|SELINUX=disabled|g' /etc/selinux/config
setenforce 0
getenforce

Add repositories to all VMs which point to repository satellite.

ping lt58ncp1sat1
rm /etc/yum.repos.d/epel*
vi /etc/yum.repos.d/lt58ncp1sat1.repo
dnf repolist
dnf update

Manually install MariaDB server to the node and let ClusterControl configure it. Otherwise, ClusterControl will automatically add repositories to nodes (that we want to avoid and use only specified ones).

dnf install MariaDB-server MariaDB-client galera-4 MariaDB-common MariaDB-backup
systemctl enable mariadb
systemctl start mariadb
systemctl status mariadb

On the day of writing, there is transition period caused by renamed commands in the scritps. That is why, additional tricks needed to make the script work (and keep installations script integrity).

# commented below only on ClusterControl node:
#? ln -s /usr/bin/mariadb            /opt/mysql/bin/mysql
#? vi .bashrc 
#? add to the path ":/opt/mysql/bin/"

# rest - everywhere
ln -s /usr/bin/mariadb            /usr/bin/mysql
ln -s /usr/sbin/mariadbd          /usr/bin/mysqld
ln -s /usr/bin/mariadb-admin      /usr/bin/mysqladmin
ln -s /usr/bin/mariadb-install-db /usr/bin/mysql_install_db

Offline installation

wget http://www.severalnines.com/downloads/cmon/install-cc
chmod +x ./install-cc 
OFFLINE=true ./install-cc

Prepare databse storage

export host="$(hostname)"
mkdir -p /mnt/${host}-data/data/mariadb/clusters/ncp/
# ? TODO: permissions
# ? TODO: selinux context

Post-installation is necessary to give permissions to ClusterControl to login into nodes to peform actions (deploy the cluster). Root user as per documentation, but any other user with enough privileges can do.

sudo su
ssh-keygen -t ed25519
ssh 0
ls -la .ssh
cat .ssh/known_hosts 
ssh-copy-id root@lt58ncp1dbm1
ssh-copy-id root@lt58ncp1dbn1
ssh-copy-id root@lt58ncp1dbn2
ssh-copy-id root@lt58ncp1dbn3

Deploy new cluster from ClusterControl dashboard

In case needed, to remove MariaDB:

dnf remove maria*
rm -rf /var/lib/mysql/

ref.

https://docs.severalnines.com/docs/clustercontrol/installation/offline-installation/