デフォルトではcentos7はmariadbのバージョンは5系が入ります。
それを10系にバージョンアップ・アップデートしてみました。
現在のバージョンを確認
# mysql –version
mysql Ver 15.1 Distrib 5.5.56-MariaDB, for Linux (x86_64) using readline 5.1
5系ですね。
念のため作業開始前にdatabeseのdumpを取っておきます。
# mysqldump -u root -p -x –all-database > dump.sql
Enter password:
mariadbのサイトに有るようにrepoを書き換えます。
enabledの項目が有りませんでしたので書き加えてます。
# cat /etc/yum.repos.d/mariadb.repo
# MariaDB 10.2 CentOS repository list – created 2018-01-06 12:36 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
enabled=1
準備ができたのでupdateします。
phpと違いmariadbを落とします。
# systemctl stop mariadb
リポジトリを綺麗にして
# yum clean all
update内容を確認
# yum check-update
略・・・
Determining fastest mirrors
* base: ftp.tsukuba.wide.ad.jp
* epel: mirror.dmmlabs.jp
* extras: ftp.tsukuba.wide.ad.jp
* remi-php72: mirrors.mediatemple.net
* updates: ftp.tsukuba.wide.ad.jp
Obsoleting Packages
MariaDB-client.x86_64 10.2.12-1.el7.centos mariadb
mariadb.x86_64 1:5.5.56-2.el7 @base
MariaDB-compat.x86_64 10.2.12-1.el7.centos mariadb
mariadb-libs.x86_64 1:5.5.56-2.el7 @base
MariaDB-server.x86_64 10.2.12-1.el7.centos mariadb
mariadb-server.x86_64 1:5.5.56-2.el7 @base
こんな感じで上がるようです。
それではupdate実施です。
# yum -y update
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
* base: ftp.tsukuba.wide.ad.jp
* epel: mirror.dmmlabs.jp
* extras: ftp.tsukuba.wide.ad.jp
* remi-php72: mirrors.mediatemple.net
* updates: ftp.tsukuba.wide.ad.jp
Resolving Dependencies
–> Running transaction check
—> Package MariaDB-client.x86_64 0:10.2.12-1.el7.centos will be obsoleting
–> Processing Dependency: MariaDB-common for package: MariaDB-client-10.2.12-1.el7.centos.x86_64
—> Package MariaDB-compat.x86_64 0:10.2.12-1.el7.centos will be obsoleting
—> Package MariaDB-server.x86_64 0:10.2.12-1.el7.centos will be obsoleting
–> Processing Dependency: galera for package: MariaDB-server-10.2.12-1.el7.centos.x86_64
–> Processing Dependency: lsof for package: MariaDB-server-10.2.12-1.el7.centos.x86_64
—> Package mariadb.x86_64 1:5.5.56-2.el7 will be obsoleted
—> Package mariadb-libs.x86_64 1:5.5.56-2.el7 will be obsoleted
—> Package mariadb-server.x86_64 1:5.5.56-2.el7 will be obsoleted
–> Running transaction check
—> Package MariaDB-common.x86_64 0:10.2.12-1.el7.centos will be installed
—> Package galera.x86_64 0:25.3.22-1.rhel7.el7.centos will be installed
–> Processing Dependency: libboost_program_options.so.1.53.0()(64bit) for package: galera-25.3.22-1.rhel7.el7.centos.x86_64
—> Package lsof.x86_64 0:4.87-4.el7 will be installed
–> Running transaction check
—> Package boost-program-options.x86_64 0:1.53.0-27.el7 will be installed
–> Finished Dependency ResolutionDependencies Resolved
================================================================================
Package Arch Version Repository
Size
================================================================================
Installing:
MariaDB-client x86_64 10.2.12-1.el7.centos mariadb 48 M
replacing mariadb.x86_64 1:5.5.56-2.el7
MariaDB-compat x86_64 10.2.12-1.el7.centos mariadb 2.8 M
replacing mariadb-libs.x86_64 1:5.5.56-2.el7
MariaDB-server x86_64 10.2.12-1.el7.centos mariadb 110 M
replacing mariadb-server.x86_64 1:5.5.56-2.el7
Installing for dependencies:
MariaDB-common x86_64 10.2.12-1.el7.centos mariadb 154 k
boost-program-options x86_64 1.53.0-27.el7 base 156 k
galera x86_64 25.3.22-1.rhel7.el7.centos mariadb 8.0 M
lsof x86_64 4.87-4.el7 base 331 kTransaction Summary
================================================================================
Install 3 Packages (+4 Dependent packages)Total download size: 169 M
Downloading packages:
(1/7): MariaDB-10.2.12-centos7-x86_64-common.rpm | 154 kB 00:01
(2/7): MariaDB-10.2.12-centos7-x86_64-compat.rpm | 2.8 MB 00:02
(3/7): boost-program-options-1.53.0-27.el7.x86_64.rpm | 156 kB 00:00
(4/7): MariaDB-10.2.12-centos7-x86_64-client.rpm | 48 MB 00:18
(5/7): lsof-4.87-4.el7.x86_64.rpm | 331 kB 00:00
(6/7): galera-25.3.22-1.rhel7.el7.centos.x86_64.rpm | 8.0 MB 00:02
(7/7): MariaDB-10.2.12-centos7-x86_64-server.rpm | 110 MB 00:27
——————————————————————————–
Total 5.6 MB/s | 169 MB 00:30
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : MariaDB-common-10.2.12-1.el7.centos.x86_64 1/10
warning: /etc/my.cnf created as /etc/my.cnf.rpmnew
Installing : MariaDB-compat-10.2.12-1.el7.centos.x86_64 2/10
Installing : MariaDB-client-10.2.12-1.el7.centos.x86_64 3/10
Installing : boost-program-options-1.53.0-27.el7.x86_64 4/10
Installing : galera-25.3.22-1.rhel7.el7.centos.x86_64 5/10
Installing : lsof-4.87-4.el7.x86_64 6/10
Installing : MariaDB-server-10.2.12-1.el7.centos.x86_64 7/10
Erasing : 1:mariadb-server-5.5.56-2.el7.x86_64 8/10
warning: /var/log/mariadb/mariadb.log saved as /var/log/mariadb/mariadb.log.rpmsave
Erasing : 1:mariadb-5.5.56-2.el7.x86_64 9/10
Erasing : 1:mariadb-libs-5.5.56-2.el7.x86_64 10/10
Verifying : galera-25.3.22-1.rhel7.el7.centos.x86_64 1/10
Verifying : MariaDB-compat-10.2.12-1.el7.centos.x86_64 2/10
Verifying : MariaDB-client-10.2.12-1.el7.centos.x86_64 3/10
Verifying : lsof-4.87-4.el7.x86_64 4/10
Verifying : boost-program-options-1.53.0-27.el7.x86_64 5/10
Verifying : MariaDB-common-10.2.12-1.el7.centos.x86_64 6/10
Verifying : MariaDB-server-10.2.12-1.el7.centos.x86_64 7/10
Verifying : 1:mariadb-libs-5.5.56-2.el7.x86_64 8/10
Verifying : 1:mariadb-server-5.5.56-2.el7.x86_64 9/10
Verifying : 1:mariadb-5.5.56-2.el7.x86_64 10/10Installed:
MariaDB-client.x86_64 0:10.2.12-1.el7.centos
MariaDB-compat.x86_64 0:10.2.12-1.el7.centos
MariaDB-server.x86_64 0:10.2.12-1.el7.centosDependency Installed:
MariaDB-common.x86_64 0:10.2.12-1.el7.centos
boost-program-options.x86_64 0:1.53.0-27.el7
galera.x86_64 0:25.3.22-1.rhel7.el7.centos
lsof.x86_64 0:4.87-4.el7Replaced:
mariadb.x86_64 1:5.5.56-2.el7 mariadb-libs.x86_64 1:5.5.56-2.el7
mariadb-server.x86_64 1:5.5.56-2.el7Complete!
問題なく上がったようです。
バージョンを確認
# mysql –version
mysql Ver 15.1 Distrib 10.2.12-MariaDB, for Linux (x86_64) using readline 5.1
10系に上がってます。
それでは、サービスを起動してみます。
# systemctl start mariadb
何事もなく起動したようですが念の為確認します。
# systemctl status mariadb
● mariadb.service – MariaDB 10.2.12 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
mqmigrated-from-my.cnf-settings.conf
Active: active (running) since Sat 2018-01-06 21:51:09 JST; 5s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 15322 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 15209 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 15206 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 15290 (mysqld)
Status: “Taking your SQL requests now…”
CGroup: /system.slice/mariadb.service
mq15290 /usr/sbin/mysqld
略・・・
正常に起動しています。
webサイトの表示・書き込みが問題ないので無事アップデートに完了しました。