maintenance:general:mariadb-10.6-upgrade
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| maintenance:general:mariadb-10.6-upgrade [2022/06/14 09:05] – [yum install] yspeerte | maintenance:general:mariadb-10.6-upgrade [2024/07/03 12:31] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== MariaDB 10.6 upgrade ====== | ||
| + | > <color orange> | ||
| + | |||
| + | This article describes the procedure to upgrade the installed Mariadb version to 10.6.x as there is no (semi) automatic process available. , the removal and initial install requires manual steps. | ||
| + | |||
| + | This procedure covers the MariaDB upgrade to version 10.6.x (specifically 10.6.8) from either \\ version **10.2.x** or **10.3.x**. \\ | ||
| + | You can verify the current version in the System status tool or using the '' | ||
| + | |||
| + | Two install options are available: | ||
| + | * semi automatic using [[#yum install|YUM install]] when an internet connection is available | ||
| + | * manually using [[#rpm install|RPM install]] when no internet connection is available. | ||
| + | |||
| + | As part of both procedures, the **yum** configuration will be modified to allow yum to __update__ Mariadb installation to the latest 10.6.x release. | ||
| + | |||
| + | ====== YUM install ====== | ||
| + | |||
| + | This procedure can only be used when a NetYCE server is connected to the internet. | ||
| + | |||
| + | > <color blue>The required Linux permissions needed include '' | ||
| + | |||
| + | ===== Prepare upgrade ===== | ||
| + | |||
| + | ==== check db ==== | ||
| + | |||
| + | Prepare the upgrade. | ||
| + | Ensure the database is free from defects: | ||
| + | < | ||
| + | $ log_maint.pl | ||
| + | </ | ||
| + | |||
| + | ==== backup YCE db ==== | ||
| + | |||
| + | Go the the **YCE database archives** tool under "Admin -> System" | ||
| + | |||
| + | ==== backup CMDB ==== | ||
| + | |||
| + | Do the same for the NCCM database using the **Backups database archives**. | ||
| + | |||
| + | |||
| + | ==== stop replication ==== | ||
| + | |||
| + | If the NetYCE server is part of a redundant master/ | ||
| + | Go the the 'Admin -> System -> System status' | ||
| + | |||
| + | Do the same for the other NetYCE database server. | ||
| + | |||
| + | ==== yum update ==== | ||
| + | |||
| + | It is recommended to update the Linux OS using '' | ||
| + | < | ||
| + | $ sudo yum update | ||
| + | |||
| + | Loaded plugins: fastestmirror | ||
| + | Loading mirror speeds from cached hostfile | ||
| + | epel/ | ||
| + | * base: mirror.1000mbps.com | ||
| + | * epel: mirrors.xtom.de | ||
| + | * extras: ftp.nluug.nl | ||
| + | * updates: nl.mirrors.clouvider.net | ||
| + | base | 3.6 kB 00:00:00 | ||
| + | epel | 4.7 kB 00:00:00 | ||
| + | extras | ||
| + | mariadb | ||
| + | mysecureshell | ||
| + | updates | ||
| + | ::: | ||
| + | Total download size: 9.9 M | ||
| + | Is this ok [y/d/N]: y | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Uninstall existing MariaDB ===== | ||
| + | |||
| + | First, halt the NetYCE application, | ||
| + | < | ||
| + | $ go down | ||
| + | </ | ||
| + | |||
| + | Then remove the old packages | ||
| + | < | ||
| + | $ rpm -qa | egrep -i ' | ||
| + | |||
| + | galera-25.3.35-1.el7.centos.x86_64 | ||
| + | MariaDB-client-10.2.44-1.el7.centos.x86_64 | ||
| + | MariaDB-devel-10.2.44-1.el7.centos.x86_64 | ||
| + | MariaDB-shared-10.2.44-1.el7.centos.x86_64 | ||
| + | MariaDB-server-10.2.44-1.el7.centos.x86_64 | ||
| + | MariaDB-common-10.2.44-1.el7.centos.x86_64 | ||
| + | MariaDB-compat-10.2.44-1.el7.centos.x86_64 | ||
| + | |||
| + | $ --nodeps -ev <all the above packages> | ||
| + | |||
| + | Or do this all at once: | ||
| + | $ rpm -qa | egrep -i ' | ||
| + | </ | ||
| + | |||
| + | ===== yum install MariaDB 10.6 ===== | ||
| + | |||
| + | To update the Centos7 or RedHat7 system, '' | ||
| + | |||
| + | Create or edit the file ''/ | ||
| + | |||
| + | The content of the file should be updated as below. On existing files only the 10.6 reference in the " | ||
| + | < | ||
| + | [MariaDB] | ||
| + | baseurl = http:// | ||
| + | enabled = 1 | ||
| + | gpgcheck = 1 | ||
| + | name = http:// | ||
| + | gpgkey = https:// | ||
| + | </ | ||
| + | |||
| + | With this yum configuration file in place, the MariaDB 10.6 installation can also be executed using '' | ||
| + | < | ||
| + | $ sudo yum install mariadb-server | ||
| + | |||
| + | Loaded plugins: fastestmirror | ||
| + | Loading mirror speeds from cached hostfile | ||
| + | * base: mirror.1000mbps.com | ||
| + | * epel: mirrors.xtom.de | ||
| + | * extras: ftp.nluug.nl | ||
| + | * updates: nl.mirrors.clouvider.net | ||
| + | Package mariadb-server is obsoleted by MariaDB-server, | ||
| + | Resolving Dependencies | ||
| + | --> Running transaction check | ||
| + | ---> Package MariaDB-server.x86_64 0: | ||
| + | --> Processing Dependency: MariaDB-common >= 10.6.1 for package: MariaDB-server-10.6.8-1.el7.centos.x86_64 | ||
| + | ::: | ||
| + | --> Finished Dependency Resolution | ||
| + | |||
| + | Dependencies Resolved | ||
| + | |||
| + | ============================================================================================================== | ||
| + | | ||
| + | ============================================================================================================== | ||
| + | Installing: | ||
| + | | ||
| + | Installing for dependencies: | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | Transaction Summary | ||
| + | ============================================================================================================== | ||
| + | Install | ||
| + | |||
| + | Total download size: 52 M | ||
| + | Installed size: 222 M | ||
| + | Is this ok [y/d/N]: y | ||
| + | ::: | ||
| + | Installed: | ||
| + | MariaDB-server.x86_64 0: | ||
| + | |||
| + | Dependency Installed: | ||
| + | MariaDB-client.x86_64 0: | ||
| + | MariaDB-compat.x86_64 0: | ||
| + | libpmem.x86_64 0: | ||
| + | socat.x86_64 0: | ||
| + | |||
| + | Complete! | ||
| + | </ | ||
| + | |||
| + | The new MariaDB is now installed but will fail to run as its default configuration file will need to be replaced. | ||
| + | |||
| + | Continue the installation using the section [[#MariaDB configuration]] section below. | ||
| + | |||
| + | |||
| + | ====== RPM install ====== | ||
| + | |||
| + | Us this procedure when the NetYCE server cannot connect to the internet. The required packages need to be downloaded and installed manually. | ||
| + | |||
| + | > <color blue>The required Linux permissions needed include '' | ||
| + | |||
| + | ===== Downloads ===== | ||
| + | |||
| + | ==== MariaDB 10.6.x ==== | ||
| + | |||
| + | Retrieve latest release of MariaDB 10.6 for CentOS7/ | ||
| + | |||
| + | point browser to: | ||
| + | https:// | ||
| + | |||
| + | find the latests versions (now 10.6.8) of the rpms for: | ||
| + | * server -> MariaDB-server-10.6.8-1.el7.centos.x86_64.rpm | ||
| + | * client -> MariaDB-client-10.6.8-1.el7.centos.x86_64.rpm | ||
| + | * common -> MariaDB-common-10.6.8-1.el7.centos.x86_64.rpm | ||
| + | * compat -> MariaDB-compat-10.6.8-1.el7.centos.x86_64.rpm | ||
| + | * shared -> MariaDB-shared-10.6.8-1.el7.centos.x86_64.rpm | ||
| + | * galera -> galera-4-26.4.11-1.el7.centos.x86_64.rpm | ||
| + | |||
| + | Note that the ' | ||
| + | * devel -> MariaDB-devel-10.6.8-1.el7.centos.x86_64.rpm | ||
| + | |||
| + | Using these filenames, retrieve them and download or copy them to the NetYCE server: | ||
| + | < | ||
| + | $ mkdir / | ||
| + | $ cd / | ||
| + | |||
| + | $ wget https:// | ||
| + | $ wget https:// | ||
| + | $ wget https:// | ||
| + | .. etc | ||
| + | </ | ||
| + | |||
| + | ==== dependencies === | ||
| + | |||
| + | The MariaDb 10.6 installation depends on some other packages that need to be installed at the same time, or installed earlier. | ||
| + | |||
| + | point browser to: | ||
| + | http:// | ||
| + | |||
| + | find the latests X68_64 versions of the rpms for: | ||
| + | * libpmem -> libpmem-1.5.1-2.1.el7.x86_64.rpm | ||
| + | * pcre2 -> pcre2-10.23-2.el7.x86_64.rpm | ||
| + | * socat -> socat-1.7.3.2-2.el7.x86_64.rpm | ||
| + | |||
| + | < | ||
| + | $ cd / | ||
| + | |||
| + | $ wget http:// | ||
| + | $ wget http:// | ||
| + | $ wget http:// | ||
| + | </ | ||
| + | |||
| + | Additionally, | ||
| + | To check which glibc version is installed: | ||
| + | < | ||
| + | $ rpm -qa | grep -i glibc | ||
| + | |||
| + | glibc-headers-2.17-326.el7_9.x86_64 | ||
| + | glibc-2.17-326.el7_9.x86_64 | ||
| + | glibc-common-2.17-326.el7_9.x86_64 | ||
| + | glibc-devel-2.17-326.el7_9.x86_64 | ||
| + | </ | ||
| + | |||
| + | If your current version is lower than the 2.17.326, download these packages from: | ||
| + | http:// | ||
| + | |||
| + | * glibc -> glibc-2.17-326.el7_9.x86_64.rpm | ||
| + | * glibc-devel -> glibc-devel-2.17-326.el7_9.x86_64.rpm | ||
| + | * glibc-common -> glibc-common-2.17-326.el7_9.x86_64.rpm | ||
| + | * glibc-headers -> glibc-headers-2.17-326.el7_9.x86_64.rpm | ||
| + | |||
| + | < | ||
| + | $ cd / | ||
| + | |||
| + | $ wget http:// | ||
| + | $ wget http:// | ||
| + | $ wget http:// | ||
| + | $ wget http:// | ||
| + | </ | ||
| + | |||
| + | ===== Prepare upgrade ===== | ||
| + | |||
| + | ==== check db ==== | ||
| + | |||
| + | Prepare the upgrade. | ||
| + | Ensure the database is free from defects: | ||
| + | < | ||
| + | $ log_maint.pl | ||
| + | </ | ||
| + | |||
| + | ==== backup YCE db ==== | ||
| + | |||
| + | Go the the **YCE database archives** tool under "Admin -> System" | ||
| + | |||
| + | ==== backup CMDB ==== | ||
| + | |||
| + | Do the same for the NCCM database using the **Backups database archives**. | ||
| + | |||
| + | |||
| + | ==== stop replication ==== | ||
| + | |||
| + | If the NetYCE server is part of a redundant master/ | ||
| + | Go the the 'Admin -> System -> System status' | ||
| + | |||
| + | Do the same for the other NetYCE database server. | ||
| + | |||
| + | |||
| + | ===== Uninstall existing MariaDB ===== | ||
| + | |||
| + | First, halt the NetYCE application, | ||
| + | < | ||
| + | $ go down | ||
| + | </ | ||
| + | |||
| + | Then remove the old packages | ||
| + | < | ||
| + | $ rpm -qa | egrep -i ' | ||
| + | |||
| + | galera-25.3.35-1.el7.centos.x86_64 | ||
| + | MariaDB-client-10.2.44-1.el7.centos.x86_64 | ||
| + | MariaDB-devel-10.2.44-1.el7.centos.x86_64 | ||
| + | MariaDB-shared-10.2.44-1.el7.centos.x86_64 | ||
| + | MariaDB-server-10.2.44-1.el7.centos.x86_64 | ||
| + | MariaDB-common-10.2.44-1.el7.centos.x86_64 | ||
| + | MariaDB-compat-10.2.44-1.el7.centos.x86_64 | ||
| + | |||
| + | $ --nodeps -ev <all the above packages> | ||
| + | |||
| + | Or do this all at once: | ||
| + | $ rpm -qa | egrep -i ' | ||
| + | </ | ||
| + | |||
| + | ===== YUM configuration ===== | ||
| + | |||
| + | To update the Centos7 or RedHat7 system, '' | ||
| + | |||
| + | Create or edit the file ''/ | ||
| + | |||
| + | The content of the file should be updated as below. On existing files only the 10.6 reference in the " | ||
| + | < | ||
| + | [MariaDB] | ||
| + | baseurl = http:// | ||
| + | enabled = 1 | ||
| + | gpgcheck = 1 | ||
| + | name = http:// | ||
| + | gpgkey = https:// | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== rpm install MariaDB 10.6 ===== | ||
| + | |||
| + | From the location of the downloaded rpm files | ||
| + | < | ||
| + | $ cd / | ||
| + | </ | ||
| + | |||
| + | Install all packages at once. Trying to do these one-by-one will result in circular dependencies. | ||
| + | < | ||
| + | $ sudo rpm -Uvh *.rpm | ||
| + | |||
| + | Preparing... | ||
| + | Updating / installing... | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | 10: | ||
| + | </ | ||
| + | |||
| + | The new MariaDB is now installed but will fail to run as its default configuration file will need to be replaced. | ||
| + | |||
| + | Continue the installation using the section [[#MariaDB configuration]] section below. | ||
| + | |||
| + | |||
| + | ====== MariaDB configuration ====== | ||
| + | |||
| + | First the NetYCE process monitor needs to be started: | ||
| + | < | ||
| + | $ go start yce_psmon | ||
| + | -- starting Daemon ' | ||
| + | yce_psmon: | ||
| + | start: / | ||
| + | wait start ' | ||
| + | done | ||
| + | </ | ||
| + | |||
| + | Then, to re-create the configuration file for the MariaDB, run the '' | ||
| + | < | ||
| + | $ yce_setup.pl -r | ||
| + | </ | ||
| + | |||
| + | This command will regenerate the configuration files for all NetYCE components and will (re)start the relevant processes. It will also start the MaraDB server. | ||
| + | |||
| + | During this initial run of '' | ||
| + | |||
| + | To complete the configuration, | ||
| + | < | ||
| + | $ yce_setup.pl - r | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Verifications ===== | ||
| + | |||
| + | Verify the NetYCE setup acknowledges the MariaDB dependencies are met: | ||
| + | < | ||
| + | $ ck_setup.pl | ||
| + | |||
| + | -- OK. Have a ' | ||
| + | -- OK. Have a supported EL7 distribution: | ||
| + | -- OK. Have YCEperl version ' | ||
| + | -- OK. Found current ' | ||
| + | -- OK. Found link to previous ' | ||
| + | -- OK. Mariadb version ' | ||
| + | -- OK. Found required mysql library ' | ||
| + | </ | ||
| + | |||
| + | Next, the upgrade will require some updates to the database tables. This command will check and optimize all tables after the initial ' | ||
| + | < | ||
| + | $ mysql_repair.sh | ||
| + | </ | ||
| + | |||
| + | When done, these commands are part of the daily maintenance and should produce no errors: | ||
| + | |||
| + | < | ||
| + | $ log_maint.pl | ||
| + | |||
| + | $ logs_daily.pl | ||
| + | |||
| + | $ nccm_daily.pl | ||
| + | </ | ||
| + | |||
| + | To check if the database can be properly accessed, use the '' | ||
| + | < | ||
| + | $ ck_license -X | ||
| + | This will output license details like: | ||
| + | |||
| + | OK: Version ' | ||
| + | OK: License will not expire until ' | ||
| + | OK: Architecture license Full. Found ' | ||
| + | OK: Users license ' | ||
| + | OK: Scheduled jobs license ' | ||
| + | OK: Client-types license ' | ||
| + | OK: Service-types license ' | ||
| + | OK: Node license ' | ||
| + | OK: Port license ' | ||
| + | OK: Service license ' | ||
| + | OK: Node-compliance license ' | ||
| + | OK: Mpls_vrf license ' | ||
| + | </ | ||
| + | |||
| + | ===== Restoring replication ===== | ||
| + | |||
| + | After - and only after - **both** NetYCE servers are upgraded to use MariaDB 10.6 can the master/ | ||
| + | |||
| + | This involves the (re)configuration of the replication between the servers using the information provided in an earlier '' | ||
| + | |||
| + | But as both systems will have been unable to communicate for a while, the databases are almost certainly out-of-sync. To restore synchronization, | ||
| + | |||
| + | < | ||
| + | $ ck_dbsync.pl -R -x | ||
| + | </ | ||
| + | |||
| + | When done, the synchronization status should look like this: | ||
| + | < | ||
| + | $ ck_dbsync.pl | ||
| + | 2022-06-08 17:49:23 === Started === | ||
| + | 2022-06-08 17:49:23 Defaulting to replication status (try -h for help) | ||
| + | 2022-06-08 17:49:23 Using local PRI and remote SEC setup: | ||
| + | 2022-06-08 17: | ||
| + | 2022-06-08 17: | ||
| + | 2022-06-08 17:49:23 Connected to both databases | ||
| + | 2022-06-08 17:49:23 1/1 Sync status | ||
| + | 2022-06-08 17:49:23 1/1 Replication status | ||
| + | 2022-06-08 17:49:23 1/1 PRI slave IO : Yes | ||
| + | 2022-06-08 17:49:23 1/1 PRI slave SQL: Yes | ||
| + | 2022-06-08 17:49:23 1/1 SEC slave IO : Yes | ||
| + | 2022-06-08 17:49:23 1/1 SEC slave SQL: Yes | ||
| + | 2022-06-08 17:49:23 === Completed === | ||
| + | </ | ||
| + | |||
| + | ===== Create 10.6 archives ====== | ||
| + | |||
| + | To complete the upgrade save the upgraded 10.6 databases using the archiving tools. | ||
| + | |||
| + | Go the the YCE database archives tool under “Admin → System”. Create a manual archive with a description indicating it is using the new version of the MariaDB, eg “Mariadb 10.6 post-upgrade” | ||
| + | |||
| + | Do the same for the Backups archive. | ||
| + | |||
| + | // | ||