{"id":783,"date":"2020-08-09T15:06:15","date_gmt":"2020-08-09T15:06:15","guid":{"rendered":"http:\/\/www.linuxauthority.com\/wordpress\/?p=783"},"modified":"2020-08-09T15:32:37","modified_gmt":"2020-08-09T15:32:37","slug":"upgrading-mariadb-cluster-lab","status":"publish","type":"post","link":"https:\/\/www.linuxauthority.com\/wordpress\/?p=783","title":{"rendered":"Upgrading mariadb cluster lab"},"content":{"rendered":"\n<!-- ALL ADSENSE ADS DISABLED -->\n\n<p>Step 1: Back up your data.<\/p>\n\n\n\n<p>Step 2: BACK UP YOUR DATA.<\/p>\n\n\n\n<p>Step 3: BACK UP YOUR FRACKING DATA (Never watched the new Battlestar Galactica this is an f-word replacement). You might lose your data.<\/p>\n\n\n\n<p>Read the procedure and process and RELEASE notes on Mariadb web site.<\/p>\n\n\n\n<p>link as of this publish date: <a href=\"https:\/\/mariadb.com\/kb\/en\/upgrading-from-mariadb-104-to-mariadb-105\/\">https:\/\/mariadb.com\/kb\/en\/upgrading-from-mariadb-104-to-mariadb-105\/<\/a><\/p>\n\n\n\n<p>There are equally good documents for any Mariadb 10.x database to 10.5.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>Yes you can run Oracle workloads without paying for an Oracle database.<\/p>\n\n\n\n<p>I think this is a multi-billion market opportunity. If you would like to explore equity partnership in this idea: <a href=\"https:\/\/newdatacloud.com\">https:\/\/newdatacloud.com<\/a><\/p>\n\n\n\n<p>Click on our <a href=\"https:\/\/www.newdatacloud.com\/wordpress\/investor-presentation\/\">investor presentation<\/a>: <\/p>\n\n\n\n<p><strong>The upgrade:<\/strong><\/p>\n\n\n\n<p>It is actually scripted.<\/p>\n\n\n\n<p>systemctl stop mariadb<\/p>\n\n\n\n<p>rc=$?<\/p>\n\n\n\n<p>### 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.<\/p>\n\n\n\n<p>if [ ${rc} = 0 ]<\/p>\n\n\n\n<p>then<\/p>\n\n\n\n<p>&nbsp; echo &#8220;DBshutdown succesfull. Performing the upgrade.&#8221;<\/p>\n\n\n\n<p>else<\/p>\n\n\n\n<p>&nbsp; echo &#8220;DB shutdown failed. Was it running? Exit 1&#8221;<\/p>\n\n\n\n<p>&nbsp; exit 1<\/p>\n\n\n\n<p>fi<\/p>\n\n\n\n<p>### 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.<\/p>\n\n\n\n<p>rpm -qa | egrep -i &#8220;mariadb|galera&#8221; | while read -r pn<\/p>\n\n\n\n<p>do<\/p>\n\n\n\n<p>&nbsp;&nbsp; rpm -e &#8211;nodeps ${pn}<\/p>\n\n\n\n<p>&nbsp;&nbsp; echo $?   ##Checking return code is always a good thing. Feel free to insert the exit on non-zero return code logic here.<\/p>\n\n\n\n<p>done<br><\/p>\n\n\n\n<p>## Edit \/etc\/yum.repos.d\/mariadb.repo and change 10.X to 10.5<\/p>\n\n\n\n<p>## The following scp command copies in a pre-prepared version of the new repository. Mine lives on instance-8.<\/p>\n\n\n\n<p>scp instance-8:\/etc\/yum.repos.d\/mariadb.repo \/etc\/yum.repos.d\/<\/p>\n\n\n\n<p>yum -y install MariaDB-compat galera-4 MariaDB-shared MariaDB-client MariaDB-server MariaDB-common MariaDB-devel<\/p>\n\n\n\n<p>## A new nonclustered server.cnf file is in place. Start the database.<\/p>\n\n\n\n<p>mysql_upgrade<\/p>\n\n\n\n<p>systemctl stop mariadb<\/p>\n\n\n\n<p>### cd \/etc\/my.cnf.d\/<\/p>\n\n\n\n<p>## mv *.cnf \/root\/<\/p>\n\n\n\n<p>## move the .rpmsave files to .cnf . Read the release notes and comment out questionable or deprecated parameters.<\/p>\n\n\n\n<p>## 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<\/p>\n\n\n\n<p>## Run for 2-4 weeks in the lab with application testing before upgrading production<\/p>\n\n\n\n<p>Script output:<\/p>\n\n\n\n<p>Loaded plugins: fastestmirror, langpacks, priorities<br>\nLoading mirror speeds from cached hostfile<br>\nepel\/x86_64\/metalink                                     |  14 kB     00:00     <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>base: mirror.cc.columbia.edu<\/li><li>epel: mirror.siena.edu<\/li><li>extras: ftpmirror.your.org<\/li><li>remi-php72: mirrors.mediatemple.net<\/li><li>remi-php73: mirrors.mediatemple.net<\/li><li>remi-safe: mirrors.mediatemple.net<\/li><li>updates: mirror.es.its.nyu.edu<\/li><li>webtatic: us-east.repo.webtatic.com<br>\nbase                                                     | 3.6 kB     00:00     <br>\nepel                                                     | 4.7 kB     00:00     <br>\nextras                                                   | 2.9 kB     00:00     <br>\nmariadb                                                  | 2.9 kB     00:00     <br>\nremi-php72                                               | 3.0 kB     00:00     <br>\nremi-php73                                               | 3.0 kB     00:00     <br>\nremi-safe                                                | 3.0 kB     00:00     <br>\nupdates                                                  | 2.9 kB     00:00     <br>\nwebtatic                                                 | 3.6 kB     00:00     <br>\n(1\/6): mariadb\/primary_db                                  |  60 kB   00:12     <br>\n(2\/6): epel\/x86_64\/updateinfo                              | 1.0 MB   00:15     <br>\n(3\/6): remi-php73\/primary_db                               | 225 kB   00:12     <br>\n(4\/6): remi-php72\/primary_db                               | 239 kB   00:13     <br>\n(5\/6): remi-safe\/primary_db                                | 1.8 MB   00:05     <br>\n(6\/6): epel\/x86_64\/primary_db                              | 6.9 MB   00:20     <br>\nResolving Dependencies<br>\n&#8211;&gt; Running transaction check<br>\n&#8212;&gt; Package MariaDB-client.x86_64 0:10.5.4-1.el7.centos will be installed<br>\n&#8212;&gt; Package MariaDB-common.x86_64 0:10.5.4-1.el7.centos will be installed<br>\n&#8212;&gt; Package MariaDB-compat.x86_64 0:10.5.4-1.el7.centos will be installed<br>\n&#8212;&gt; Package MariaDB-devel.x86_64 0:10.5.4-1.el7.centos will be installed<br>\n&#8212;&gt; Package MariaDB-server.x86_64 0:10.5.4-1.el7.centos will be installed<br>\n&#8212;&gt; Package MariaDB-shared.x86_64 0:10.5.4-1.el7.centos will be installed<br>\n&#8212;&gt; Package galera-4.x86_64 0:26.4.5-1.el7.centos will be installed<br>\n&#8211;&gt; Finished Dependency Resolution<\/li><\/ul>\n\n\n\n<p>Dependencies Resolved<\/p>\n\n\n\n<p>================================================================================<\/p>\n\n\n\n<p> Package             Arch        Version                     Repository    Size<\/p>\n\n\n\n<p>Installing:<br>\n MariaDB-client      x86_64      10.5.4-1.el7.centos         mariadb       13 M<br>\n MariaDB-common      x86_64      10.5.4-1.el7.centos         mariadb       81 k<br>\n MariaDB-compat      x86_64      10.5.4-1.el7.centos         mariadb      2.2 M<br>\n MariaDB-devel       x86_64      10.5.4-1.el7.centos         mariadb      8.0 M<br>\n MariaDB-server      x86_64      10.5.4-1.el7.centos         mariadb       26 M<br>\n MariaDB-shared      x86_64      10.5.4-1.el7.centos         mariadb      113 k<br>\n galera-4            x86_64      26.4.5-1.el7.centos         mariadb      9.5 M<\/p>\n\n\n\n<p>Transaction Summary<\/p>\n\n\n\n<p>Install  7 Packages<\/p>\n\n\n\n<p>Total download size: 59 M<br>\nInstalled size: 59 M<br>\nDownloading packages:<br>\nNo Presto metadata available for mariadb<br>\n(1\/7): MariaDB-common-10.5.4-1.el7.centos.x86_64.rpm       |  81 kB   00:03     <br>\n(2\/7): MariaDB-compat-10.5.4-1.el7.centos.x86_64.rpm       | 2.2 MB   00:02     <br>\n(3\/7): MariaDB-client-10.5.4-1.el7.centos.x86_64.rpm       |  13 MB   00:14     <br>\n(4\/7): MariaDB-devel-10.5.4-1.el7.centos.x86_64.rpm        | 8.0 MB   00:09     <br>\n(5\/7): MariaDB-shared-10.5.4-1.el7.centos.x86_64.rpm       | 113 kB   00:00     <br>\n(6\/7): galera-4-26.4.5-1.el7.centos.x86_64.rpm             | 9.5 MB   00:05     <\/p>\n\n\n\n<p>(7\/7): MariaDB-server-10.5.4-1.el7.centos.x86_64.rpm       |  26 MB   00:10     <\/p>\n\n\n\n<p>Total                                              2.3 MB\/s |  59 MB  00:25     <br>\nRunning transaction check<br>\nRunning transaction test<br>\nTransaction test succeeded<br>\nRunning transaction<br>\nWarning: RPMDB altered outside of yum.<br>\n** Found 12 pre-existing rpmdb problem(s), &#8216;yum check&#8217; output follows:<br>\n1:dovecot-mysql-2.2.36-6.el7.x86_64 has missing requires of libmysqlclient.so.18()(64bit)<br>\n1:dovecot-mysql-2.2.36-6.el7.x86_64 has missing requires of libmysqlclient.so.18(libmysqlclient_18)(64bit)<br>\nkrb5-devel-1.15.1-46.el7.x86_64 has missing requires of krb5-libs(x86-64) = (&#8216;0&#8217;, &#8216;1.15.1&#8217;, &#8217;46.el7&#8242;)<br>\nlibkadm5-1.15.1-46.el7.x86_64 has missing requires of krb5-libs(x86-64) = (&#8216;0&#8217;, &#8216;1.15.1&#8217;, &#8217;46.el7&#8242;)<br>\n1:net-snmp-5.7.2-48.el7_8.x86_64 has missing requires of libmysqlclient.so.18()(64bit)<br>\n1:net-snmp-5.7.2-48.el7_8.x86_64 has missing requires of mysql-libs<br>\n1:net-snmp-agent-libs-5.7.2-48.el7_8.x86_64 has missing requires of libmysqlclient.so.18()(64bit)<br>\n1:net-snmp-agent-libs-5.7.2-48.el7_8.x86_64 has missing requires of libmysqlclient.so.18(libmysqlclient_18)(64bit)<br>\nperl-DBD-MySQL-4.023-6.el7.x86_64 has missing requires of libmysqlclient.so.18()(64bit)<br>\nperl-DBD-MySQL-4.023-6.el7.x86_64 has missing requires of libmysqlclient.so.18(libmysqlclient_18)(64bit)<br>\npure-ftpd-1.0.47-3.el7.x86_64 has missing requires of libmysqlclient.so.18()(64bit)<br>\npure-ftpd-1.0.47-3.el7.x86_64 has missing requires of libmysqlclient.so.18(libmysqlclient_18)(64bit)<br>\n  Installing : MariaDB-common-10.5.4-1.el7.centos.x86_64                    1\/7 <br>\n  Installing : MariaDB-compat-10.5.4-1.el7.centos.x86_64                    2\/7 <br>\n  Installing : MariaDB-client-10.5.4-1.el7.centos.x86_64                    3\/7 <br>\n  Installing : galera-4-26.4.5-1.el7.centos.x86_64                          4\/7 <br>\n  Installing : MariaDB-server-10.5.4-1.el7.centos.x86_64                    5\/7 <br>\n  Installing : MariaDB-devel-10.5.4-1.el7.centos.x86_64                     6\/7 <br>\n  Installing : MariaDB-shared-10.5.4-1.el7.centos.x86_64                    7\/7 <br>\n  Verifying  : MariaDB-client-10.5.4-1.el7.centos.x86_64                    1\/7 <br>\n  Verifying  : MariaDB-devel-10.5.4-1.el7.centos.x86_64                     2\/7 <br>\n  Verifying  : MariaDB-server-10.5.4-1.el7.centos.x86_64                    3\/7 <br>\n  Verifying  : MariaDB-shared-10.5.4-1.el7.centos.x86_64                    4\/7 <br>\n  Verifying  : MariaDB-compat-10.5.4-1.el7.centos.x86_64                    5\/7 <br>\n  Verifying  : galera-4-26.4.5-1.el7.centos.x86_64                          6\/7 <br>\n  Verifying  : MariaDB-common-10.5.4-1.el7.centos.x86_64                    7\/7 <\/p>\n\n\n\n<p>Installed:<br>\n  MariaDB-client.x86_64 0:10.5.4-1.el7.centos                                   <br>\n  MariaDB-common.x86_64 0:10.5.4-1.el7.centos                                   <br>\n  MariaDB-compat.x86_64 0:10.5.4-1.el7.centos                                   <br>\n  MariaDB-devel.x86_64 0:10.5.4-1.el7.centos                                    <br>\n  MariaDB-server.x86_64 0:10.5.4-1.el7.centos                                   <br>\n  MariaDB-shared.x86_64 0:10.5.4-1.el7.centos                                   <br>\n  galera-4.x86_64 0:26.4.5-1.el7.centos                                         <\/p>\n\n\n\n<p>Complete!<br>\n<\/p>\n\n\n<p>[root@instance-6 ~]<\/p>\n\n\n\n<p># systemctl start mariadb<br><\/p>\n\n\n<p>[root@instance-6 ~]<\/p>\n\n\n\n<p># mysql_upgrade<br>\nPhase 1\/7: Checking and upgrading mysql database<br>\nProcessing databases<br>\nmysql<br>\nmysql.column_stats                                 OK<br>\nmysql.columns_priv                                 OK<br>\nmysql.db                                           OK<br>\nmysql.event                                        OK<br>\nmysql.func                                         OK<br>\n..snip..<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n<a role=\"link\" class=\"rtp-readmore\" title=\"Read more on Upgrading mariadb cluster lab\" href=\"https:\/\/www.linuxauthority.com\/wordpress\/?p=783\" rel=\"nofollow\">Read More &rarr;<\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73,76,9,21],"tags":[],"class_list":["post-783","post","type-post","status-publish","format-standard","hentry","category-mysql","category-postfix","category-scripting-2","category-systems-administration"],"_links":{"self":[{"href":"https:\/\/www.linuxauthority.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/783"}],"collection":[{"href":"https:\/\/www.linuxauthority.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxauthority.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxauthority.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxauthority.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=783"}],"version-history":[{"count":3,"href":"https:\/\/www.linuxauthority.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/783\/revisions"}],"predecessor-version":[{"id":786,"href":"https:\/\/www.linuxauthority.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/783\/revisions\/786"}],"wp:attachment":[{"href":"https:\/\/www.linuxauthority.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxauthority.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=783"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxauthority.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}