Categories
Programming

Upgrade of Galera Cluster from 10.1 to 10.2

This is how i did a rolling upgrade of an MariaDB Galera Cluster from version 10.1 to 10.2 in CentOS 7. Reference Upgrading Galera Cluster.

Step

Update yum repositories.

cat <<'EOF' >/etc/yum.repos.d/MariaDB.repo
[mariadb-main]
name = MariaDB Server
baseurl = https://downloads.mariadb.com/MariaDB/mariadb-10.2/yum/rhel/$releasever/$basearch
gpgkey = file:///etc/pki/rpm-gpg/MariaDB-Server-GPG-KEY
gpgcheck = 1
enabled = 1

[mariadb-maxscale]
# To use the latest stable release of MaxScale, use "latest" as the version
# To use the latest beta (or stable if no current beta) release of MaxScale, use "beta" as the version
name = MariaDB MaxScale
baseurl = https://downloads.mariadb.com/MaxScale/2.1/rhel/$releasever/$basearch
gpgkey = file:///etc/pki/rpm-gpg/MariaDB-MaxScale-GPG-KEY
gpgcheck = 1
enabled = 1

[mariadb-tools]
name = MariaDB Tools
baseurl = https://downloads.mariadb.com/Tools/rhel/$releasever/$basearch
gpgkey = file:///etc/pki/rpm-gpg/MariaDB-Enterprise-GPG-KEY
gpgcheck = 1
enabled = 1
EOF

Step 2

Run upgrade

systemctl stop mariadb.service

yum remove MariaDB-server -y
yum install MariaDB-server -y
yum update -y

cp /etc/my.cnf.d/server.cnf.rpmsave /etc/my.cnf.d/server.cnf
sed -i.bak s/wsrep_on=/#wsrep_on=/g /etc/my.cnf.d/server.cnf
sed -i.bak s/wsrep_provider=/#wsrep_provider=/g /etc/my.cnf.d/server.cnf

systemctl start mariadb.service
mysql_upgrade -p
systemctl stop mariadb.service

sed -i.bak s/#wsrep_on=/wsrep_on=/g /etc/my.cnf.d/server.cnf
sed -i.bak s/#wsrep_provider=/wsrep_provider=/g /etc/my.cnf.d/server.cnf

systemctl start mariadb.service