Upgrading mariadb cluster lab

Step 1: Back up your data.

Step 2: BACK UP YOUR DATA.

Step 3: BACK UP YOUR FRACKING DATA (Never watched the new Battlestar Galactica this is an f-word replacement). You might lose your data.

Read the procedure and process and RELEASE notes on Mariadb web site.

link as of this publish date: https://mariadb.com/kb/en/upgrading-from-mariadb-104-to-mariadb-105/

There are equally good documents for any Mariadb 10.x database to 10.5.

Why did do the lab upgrade? I think Oracle database is a big rip off and since version 10.3 Mariadb can run workloads requiring Oracle pl/sql code.

Yes you can run Oracle workloads without paying for an Oracle database.

I think this is a multi-billion market opportunity. If you would like to explore equity partnership in this idea: https://newdatacloud.com

Click on our investor presentation:

The upgrade:

It is actually scripted.

systemctl stop mariadb

rc=$?

### make sure the database shutdown actually succeeds check the return code. 0 is good. Anything else: Do not pass go, do not collect $200. Get that database down cleanly and back up your data.

if [ ${rc} = 0 ]

then

  echo “DBshutdown succesfull. Performing the upgrade.”

else

  echo “DB shutdown failed. Was it running? Exit 1”

  exit 1

fi

### get a list of mariadb and galera packages and remove them not the dozens of packages that depend on Mariadb. Mariadb will be back in 10 minutes and all dependencies will be happy. Take note of the messages and make sure all shared libraries are present on the system.

rpm -qa | egrep -i “mariadb|galera” | while read -r pn

do

   rpm -e –nodeps ${pn}

   echo $? ##Checking return code is always a good thing. Feel free to insert the exit on non-zero return code logic here.

done

## Edit /etc/yum.repos.d/mariadb.repo and change 10.X to 10.5

## The following scp command copies in a pre-prepared version of the new repository. Mine lives on instance-8.

scp instance-8:/etc/yum.repos.d/mariadb.repo /etc/yum.repos.d/

yum -y install MariaDB-compat galera-4 MariaDB-shared MariaDB-client MariaDB-server MariaDB-common MariaDB-devel

## A new nonclustered server.cnf file is in place. Start the database.

mysql_upgrade

systemctl stop mariadb

### cd /etc/my.cnf.d/

## mv *.cnf /root/

## move the .rpmsave files to .cnf . Read the release notes and comment out questionable or deprecated parameters.

## galera_recovery;galera_new_cluster on the master node, Make certain the safe_to_bootstrap parameter is set to 1 in /var/lib/mysql/grastate.dat

## Run for 2-4 weeks in the lab with application testing before upgrading production

Script output:

Loaded plugins: fastestmirror, langpacks, priorities
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 14 kB 00:00

  • base: mirror.cc.columbia.edu
  • epel: mirror.siena.edu
  • extras: ftpmirror.your.org
  • remi-php72: mirrors.mediatemple.net
  • remi-php73: mirrors.mediatemple.net
  • remi-safe: mirrors.mediatemple.net
  • updates: mirror.es.its.nyu.edu
  • webtatic: us-east.repo.webtatic.com
    base | 3.6 kB 00:00
    epel | 4.7 kB 00:00
    extras | 2.9 kB 00:00
    mariadb | 2.9 kB 00:00
    remi-php72 | 3.0 kB 00:00
    remi-php73 | 3.0 kB 00:00
    remi-safe | 3.0 kB 00:00
    updates | 2.9 kB 00:00
    webtatic | 3.6 kB 00:00
    (1/6): mariadb/primary_db | 60 kB 00:12
    (2/6): epel/x86_64/updateinfo | 1.0 MB 00:15
    (3/6): remi-php73/primary_db | 225 kB 00:12
    (4/6): remi-php72/primary_db | 239 kB 00:13
    (5/6): remi-safe/primary_db | 1.8 MB 00:05
    (6/6): epel/x86_64/primary_db | 6.9 MB 00:20
    Resolving Dependencies
    –> Running transaction check
    —> Package MariaDB-client.x86_64 0:10.5.4-1.el7.centos will be installed
    —> Package MariaDB-common.x86_64 0:10.5.4-1.el7.centos will be installed
    —> Package MariaDB-compat.x86_64 0:10.5.4-1.el7.centos will be installed
    —> Package MariaDB-devel.x86_64 0:10.5.4-1.el7.centos will be installed
    —> Package MariaDB-server.x86_64 0:10.5.4-1.el7.centos will be installed
    —> Package MariaDB-shared.x86_64 0:10.5.4-1.el7.centos will be installed
    —> Package galera-4.x86_64 0:26.4.5-1.el7.centos will be installed
    –> Finished Dependency Resolution

Dependencies Resolved

================================================================================

Package Arch Version Repository Size

Installing:
MariaDB-client x86_64 10.5.4-1.el7.centos mariadb 13 M
MariaDB-common x86_64 10.5.4-1.el7.centos mariadb 81 k
MariaDB-compat x86_64 10.5.4-1.el7.centos mariadb 2.2 M
MariaDB-devel x86_64 10.5.4-1.el7.centos mariadb 8.0 M
MariaDB-server x86_64 10.5.4-1.el7.centos mariadb 26 M
MariaDB-shared x86_64 10.5.4-1.el7.centos mariadb 113 k
galera-4 x86_64 26.4.5-1.el7.centos mariadb 9.5 M

Transaction Summary

Install 7 Packages

Total download size: 59 M
Installed size: 59 M
Downloading packages:
No Presto metadata available for mariadb
(1/7): MariaDB-common-10.5.4-1.el7.centos.x86_64.rpm | 81 kB 00:03
(2/7): MariaDB-compat-10.5.4-1.el7.centos.x86_64.rpm | 2.2 MB 00:02
(3/7): MariaDB-client-10.5.4-1.el7.centos.x86_64.rpm | 13 MB 00:14
(4/7): MariaDB-devel-10.5.4-1.el7.centos.x86_64.rpm | 8.0 MB 00:09
(5/7): MariaDB-shared-10.5.4-1.el7.centos.x86_64.rpm | 113 kB 00:00
(6/7): galera-4-26.4.5-1.el7.centos.x86_64.rpm | 9.5 MB 00:05

(7/7): MariaDB-server-10.5.4-1.el7.centos.x86_64.rpm | 26 MB 00:10

Total 2.3 MB/s | 59 MB 00:25
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
** Found 12 pre-existing rpmdb problem(s), ‘yum check’ output follows:
1:dovecot-mysql-2.2.36-6.el7.x86_64 has missing requires of libmysqlclient.so.18()(64bit)
1:dovecot-mysql-2.2.36-6.el7.x86_64 has missing requires of libmysqlclient.so.18(libmysqlclient_18)(64bit)
krb5-devel-1.15.1-46.el7.x86_64 has missing requires of krb5-libs(x86-64) = (‘0’, ‘1.15.1’, ’46.el7′)
libkadm5-1.15.1-46.el7.x86_64 has missing requires of krb5-libs(x86-64) = (‘0’, ‘1.15.1’, ’46.el7′)
1:net-snmp-5.7.2-48.el7_8.x86_64 has missing requires of libmysqlclient.so.18()(64bit)
1:net-snmp-5.7.2-48.el7_8.x86_64 has missing requires of mysql-libs
1:net-snmp-agent-libs-5.7.2-48.el7_8.x86_64 has missing requires of libmysqlclient.so.18()(64bit)
1:net-snmp-agent-libs-5.7.2-48.el7_8.x86_64 has missing requires of libmysqlclient.so.18(libmysqlclient_18)(64bit)
perl-DBD-MySQL-4.023-6.el7.x86_64 has missing requires of libmysqlclient.so.18()(64bit)
perl-DBD-MySQL-4.023-6.el7.x86_64 has missing requires of libmysqlclient.so.18(libmysqlclient_18)(64bit)
pure-ftpd-1.0.47-3.el7.x86_64 has missing requires of libmysqlclient.so.18()(64bit)
pure-ftpd-1.0.47-3.el7.x86_64 has missing requires of libmysqlclient.so.18(libmysqlclient_18)(64bit)
Installing : MariaDB-common-10.5.4-1.el7.centos.x86_64 1/7
Installing : MariaDB-compat-10.5.4-1.el7.centos.x86_64 2/7
Installing : MariaDB-client-10.5.4-1.el7.centos.x86_64 3/7
Installing : galera-4-26.4.5-1.el7.centos.x86_64 4/7
Installing : MariaDB-server-10.5.4-1.el7.centos.x86_64 5/7
Installing : MariaDB-devel-10.5.4-1.el7.centos.x86_64 6/7
Installing : MariaDB-shared-10.5.4-1.el7.centos.x86_64 7/7
Verifying : MariaDB-client-10.5.4-1.el7.centos.x86_64 1/7
Verifying : MariaDB-devel-10.5.4-1.el7.centos.x86_64 2/7
Verifying : MariaDB-server-10.5.4-1.el7.centos.x86_64 3/7
Verifying : MariaDB-shared-10.5.4-1.el7.centos.x86_64 4/7
Verifying : MariaDB-compat-10.5.4-1.el7.centos.x86_64 5/7
Verifying : galera-4-26.4.5-1.el7.centos.x86_64 6/7
Verifying : MariaDB-common-10.5.4-1.el7.centos.x86_64 7/7

Installed:
MariaDB-client.x86_64 0:10.5.4-1.el7.centos
MariaDB-common.x86_64 0:10.5.4-1.el7.centos
MariaDB-compat.x86_64 0:10.5.4-1.el7.centos
MariaDB-devel.x86_64 0:10.5.4-1.el7.centos
MariaDB-server.x86_64 0:10.5.4-1.el7.centos
MariaDB-shared.x86_64 0:10.5.4-1.el7.centos
galera-4.x86_64 0:26.4.5-1.el7.centos

Complete!

[root@instance-6 ~]

# systemctl start mariadb

[root@instance-6 ~]

# mysql_upgrade
Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
..snip..